NAME

Data::SearchEngine::Meta::Attribute::Trait::Digestable - Digest flag & configuration

VERSION

version 0.33

DESCRIPTION

If a Data::SearchEngine::Query attribute has this meta-attribute, then it will be added to the digest that identifies the uniqueness of a Query.

If the attribute is a scalar, you do not need to specify a digest_value. The scalar value can just be added to the digest.

For example, if your Query subclass allows the choice of a particular category to search within, you would obviously want queries with different categories (or lack thereof) to have different digests.

has 'category' => (
    traits      => [qw(Digestable)],
    is          => 'rw',
    isa         => 'MyApp::Category',
    digest_value=> sub { $self->category->name }
);

When computing it's digest, your query will now add the value of the category to the computation, thereby guaranteeing uniqueness!

ATTRIBUTES

digest_value

A coderef that will return a string identifying the value of this attribute for adding to the Query's digst.

AUTHOR

Cory G Watson <gphat@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by Cold Hard Code, LLC.

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