Search::GIN::Extract::ClassMap - Delegate Extraction based on class.
version 0.01060817
my $extractor = Search::GIN::Extract::ClassMap->new( extract_isa => { 'Foo' => [qw( bar baz quux )], 'Bar' => Search::GIN::Extract::AttributeIndex->new(), 'Baz' => sub { shift; my $object = shift; { a => $object->a() } }, }, extract_does => { }, extract => { /* either ISA or DOES */ }, );
In reality, the form is more like this:
my $extractor = Search::GIN::Extract::ClassMap->new( extract_isa => { 'Foo' => Search::GIN::Extract::*, 'Bar' => Search::GIN::Extract::*, 'Baz' => Search::GIN::Extract::*, }, extract_does => { }, extract => { /* either ISA or DOES */ }, );
With the minor exception of the 2 exception cases, passing an array ref, or a coderef, which internally are typecasted to Search::GIN::Extract::Attributes and Search::GIN::Extract::Callback automatically.
This is an early release, API is prone to change without much warning, but best attempts will be made to avoid the need.
Applied on all objects where $object->isa( $classname );
HashRef's are automatically type-cast.
Applied on all objects where $object->does( $classname );
Applied on all objects where $object->does( $classname ) OR $object->isa( $classname );
this doesn't make complete sense, but its handy for lazy people.
Kent Fredric <kentnl@cpan.org>
This software is copyright (c) 2013 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.
To install Search::GIN::Extract::ClassMap, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Search::GIN::Extract::ClassMap
CPAN shell
perl -MCPAN -e shell install Search::GIN::Extract::ClassMap
For more information on module installation, please visit the detailed CPAN module installation guide.