{"id":19640383,"url":"https://github.com/kentnl/search-gin-extract-classmap","last_synced_at":"2026-05-12T21:03:04.246Z","repository":{"id":650920,"uuid":"293362","full_name":"kentnl/Search-GIN-Extract-ClassMap","owner":"kentnl","description":"Delegate Extraction based on class","archived":false,"fork":false,"pushed_at":"2017-03-07T10:14:08.000Z","size":164,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-09T18:57:00.022Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"rjbs/Rx","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kentnl.png","metadata":{"files":{"readme":"README.mkdn","changelog":"Changes","contributing":"CONTRIBUTING.pod","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-08-31T16:01:02.000Z","updated_at":"2015-08-16T05:21:42.000Z","dependencies_parsed_at":"2022-07-07T16:47:13.325Z","dependency_job_id":null,"html_url":"https://github.com/kentnl/Search-GIN-Extract-ClassMap","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentnl%2FSearch-GIN-Extract-ClassMap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentnl%2FSearch-GIN-Extract-ClassMap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentnl%2FSearch-GIN-Extract-ClassMap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentnl%2FSearch-GIN-Extract-ClassMap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kentnl","download_url":"https://codeload.github.com/kentnl/Search-GIN-Extract-ClassMap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240947648,"owners_count":19883030,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T14:05:39.288Z","updated_at":"2026-05-12T21:02:59.225Z","avatar_url":"https://github.com/kentnl.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nSearch::GIN::Extract::ClassMap - Delegate Extraction based on class.\n\n# VERSION\n\nversion 1.000004\n\n# SYNOPSIS\n\n    my $extractor = Search::GIN::Extract::ClassMap-\u003enew(\n      extract_isa =\u003e {\n        'Foo' =\u003e [qw( bar baz quux )],\n        'Bar' =\u003e Search::GIN::Extract::AttributeIndex-\u003enew(),\n        'Baz' =\u003e sub { shift; my $object = shift; { a =\u003e $object-\u003ea() } },\n      },\n      extract_does =\u003e {\n\n      },\n      extract =\u003e  {\n        /* either ISA or DOES */\n      },\n    );\n\nIn reality, the form is more like this:\n\n    my $extractor = Search::GIN::Extract::ClassMap-\u003enew(\n      extract_isa =\u003e {\n        'Foo' =\u003e Search::GIN::Extract::*,\n        'Bar' =\u003e Search::GIN::Extract::*,\n        'Baz' =\u003e Search::GIN::Extract::*,\n      },\n      extract_does =\u003e {\n\n      },\n      extract =\u003e  {\n        /* either ISA or DOES */\n      },\n    );\n\nWith the minor exception of the 2 exception cases, passing\nan `ArrayRef`, or a `CodeRef`, which internally are type-cast to\n[`Search::GIN::Extract::Attributes`](https://metacpan.org/pod/Search::GIN::Extract::Attributes)\nand [`Search::GIN::Extract::Callback`](https://metacpan.org/pod/Search::GIN::Extract::Callback)\nautomatically.\n\n# WARNING\n\nThis is an early release, `API` is prone to change without much warning, but best attempts will be made to avoid the need.\n\n# DESCRIPTION\n\nThis module is an extension for the [`Search::GIN`](https://metacpan.org/pod/Search::GIN) framework\nproviding a novel way to dictate which attribute extraction techniques will be\nused for which object by having rules that map against the objects inheritance\nor the objects composed roles.\n\nThis essentially permits you to register adapters for various object types to\nspecial-case their extraction.\n\nFor example, if you had a source tree that used classes under your control\nusing `MooseX::AttributeIndexes`, you could easily default those classes to\nextract using `Search::GIN::Extract::AttributeIndexes`. And if any objects of\nthose classes had `DateTime` properties, you could define a handler for\nextracting `DateTime` meta-data for indexing specifically.\n\n# METHODS\n\n## `extract_values`\n\n    my ( @values ) = $object-\u003eextract_values( $extractee );\n\n**for:** [`Search::GIN::Extract`](https://metacpan.org/pod/Search::GIN::Extract)\n\nIterates the contents of the `extract($|_\\w+$)` rules, and asks them to\nextract their respective information, and returns the resulting results as a\nlist.\n\n# ATTRIBUTES\n\n## `extract_isa`\n\n    my $object = Search::GIN::Extract::ClassMap-\u003enew(\n      extract_isa =\u003e $isa_thing\n    );\n    # or\n    $object-\u003eextract_isa( $isa_thing )\n\nApplied on all objects where $object-\u003eisa( $classname );\n\n### `$isa_thing`\n\n- `HashRef[ [Extractor](https://metacpan.org/pod/Search::GIN::Extract::ClassMap::Types#Extractor) ]`\n- [`CoercedClassMap`](https://metacpan.org/pod/Search::GIN::Extract::ClassMap::Types#CoercedClassMap)\n- [`::ClassMap::Isa`](https://metacpan.org/pod/Search::GIN::Extract::ClassMap::Isa)\n\n    `HashRef`'s are automatically type-cast.\n\n## `extract_does`\n\n    my $object =  Search::GIN::Extract::ClassMap-\u003enew(\n      extract_does =\u003e $does_thing\n    );\n    # or\n    $object-\u003eextract_does( $does_thing );\n\nApplied on all objects where $object-\u003edoes( $classname );\n\n### `$does_thing`\n\n- `HashRef[ [Extractor](https://metacpan.org/pod/Search::GIN::Extract::ClassMap::Types#Extractor) ]`\n- [`CoercedClassMap`](https://metacpan.org/pod/Search::GIN::Extract::ClassMap::Types#CoercedClassMap)\n- [`::ClassMap::Does`](https://metacpan.org/pod/Search::GIN::Extract::ClassMap::Does)\n\n    `HashRef`'s are automatically type-cast.\n\n## `extract`\n\n    my $object =  Search::GIN::Extract::ClassMap-\u003enew(\n      extract =\u003e $like_thing\n    );\n    # or\n    $object-\u003eextract( $like_thing );\n\nApplied on all objects where $object-\u003edoes( $classname ) OR $object-\u003eisa( $classname );\n\nthis doesn't make complete sense, but its handy for lazy people.\n\n### `$like_thing`\n\n- `HashRef[ [Extractor](https://metacpan.org/pod/Search::GIN::Extract::ClassMap::Types#Extractor) ]`\n- [`CoercedClassMap`](https://metacpan.org/pod/Search::GIN::Extract::ClassMap::Types#CoercedClassMap)\n- [`::ClassMap::Like`](https://metacpan.org/pod/Search::GIN::Extract::ClassMap::Like)\n\n    `HashRef`'s are automatically type-cast.\n\n# AUTHOR\n\nKent Fredric \u003ckentnl@cpan.org\u003e\n\n# COPYRIGHT AND LICENSE\n\nThis software is copyright (c) 2017 by Kent Fredric \u003ckentfredric@gmail.com\u003e.\n\nThis is free software; you can redistribute it and/or modify it under\nthe same terms as the Perl 5 programming language system itself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkentnl%2Fsearch-gin-extract-classmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkentnl%2Fsearch-gin-extract-classmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkentnl%2Fsearch-gin-extract-classmap/lists"}