Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kentnl/search-gin-extract-attributeindexes
Automatically collect index metadata from MooseX::AttributeIndexes consuming models
https://github.com/kentnl/search-gin-extract-attributeindexes
Last synced: 4 days ago
JSON representation
Automatically collect index metadata from MooseX::AttributeIndexes consuming models
- Host: GitHub
- URL: https://github.com/kentnl/search-gin-extract-attributeindexes
- Owner: kentnl
- License: other
- Created: 2009-08-25T10:04:07.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2017-03-07T10:19:07.000Z (over 7 years ago)
- Last Synced: 2023-08-20T22:56:04.950Z (about 1 year ago)
- Language: Perl
- Homepage:
- Size: 136 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.mkdn
- Changelog: Changes
- Contributing: CONTRIBUTING.pod
- License: LICENSE
Awesome Lists containing this project
README
# NAME
Search::GIN::Extract::AttributeIndexes - Automatically collect index metadata from MooseX::AttributeIndexes consuming models.
# VERSION
version 2.000002
# SYNOPSIS
## On your models
use MooseX::Declare;
class Model::Item {
use MooseX::Types::Moose qw(:all ):
use MooseX::AttributeIndexes;has 'attr' => (
isa => Str,
is => 'rw',
indexed => 1
);
has 'attr_bar' => (
isa => Str,
is => 'rw',
primary_index => 1
);
}## In KiokuX::Model extensions
use MooseX::Declare;
class Foo extends KiokuX::Model {
use Search::GIN::Extract::AttributeIndexes;around _build_connect_args ( Any @args ) {
my $args = $self->$orig( @args );
push @{ $args }, extract => Search::GIN::Extract::AttributeIndexes->new();
return $args;}
}## In Instantiations of KiokuDB
my $dir = KiouDB->new(
backend => KiokuDB::Backend::BDB::GIN->new(
extract => Search::GIN::Extract::AttributeIndexes->new()
)
);# DESCRIPTION
This module is an extension for the `Search::GIN` search and index framework
which allows one to operate objects of any class consuming
`MooseX::AttributeIndexes`, and extracting values from those objects for use
in indexing.This allows people to define how an object should be indexed on the class
definition itself by adding properties to attributes.# AUTHOR
Kent Fredric
# COPYRIGHT AND LICENSE
This software is copyright (c) 2017 by Kent Fredric .
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.