++ed by:
ZMUGHAL STEVIED

2 PAUSE users
1 non-PAUSE user.

Al Newkirk
and 1 contributors

NAME

Data::Seek::Search - Data::Seek Search Class

VERSION

version 0.09

SYNOPSIS

    use Data::Seek::Search;

DESCRIPTION

Data::Seek::Search is a class within Data::Seek which provides the search mechanism for introspecting data structures.

ATTRIBUTES

criteria

    $search->criteria;
    $search->criteria({
        '*'                      => 0,
        'person.name.first'      => 1,
        'person.name.last'       => 2,
        'person.@settings.name'  => 3,
        'person.@settings.type'  => 4,
        'person.@settings.value' => 5,
    });

A collection of criterion which will be used to match nodes within the data structure when introspected, in the order registered. This attribute must be a hash reference, which is coerced into a Data::Object::Hash object.

data

    $seeker->data;
    $seeker->data({...});

The data structure to be introspected, must be a hash reference, which is coerced into a Data::Object::Hash object.

ignore

    $search->ignore;
    $search->ignore(1);

Bypass exceptions thrown when a criterion is invalid or no data matches can be found. This attribute must be an integer, which is coerced into a Data::Object::Integer object.

METHODS

perform

    my $dataset = $search->perform;

Introspect the data structure using the registered criteria and settings, and return a result set of operations and matching data nodes. This result set is returned as a Data::Object::Array object.

result

    my $result = $search->result;

Return a search result object, Data::Seek::Search::Result, based on the current search object.

AUTHOR

Al Newkirk <anewkirk@ana.io>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Al Newkirk.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.