Data::SearchEngine::Meta::Attribute::Trait::Digestable - Digest flag & configuration
version 0.32
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.
digest_value
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!
A coderef that will return a string identifying the value of this attribute for adding to the Query's digst.
Cory G Watson <gphat@cpan.org>
This software is copyright (c) 2011 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.
To install Data::SearchEngine, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::SearchEngine
CPAN shell
perl -MCPAN -e shell install Data::SearchEngine
For more information on module installation, please visit the detailed CPAN module installation guide.