eris::role::dictionary::hash - Simple dictionary implementation based off a hash
version 0.005
Simplest possible dictionary implementation
package my::app::dictionary::business; use Moo; with qw( eris::role::dictionary::hash ); sub hash { return { 'customer_id' => "Our customer ID field", 'store_id' => "Our store ID field", 'price_usd' => "Object price in USD", 'transaction_key' => "Transaction Identifier", } }
Find the field in the hash, returns a hashref in the format:
{ field => $field, description => $lookup_hash{$field}, }
Or if the hash value is a hash reference, we return:
{ field => $field, %{ $lookup_hash{$field} }, }
Returns the sorted list of keys in the lookup hash
Return a HashRef with the field names as keys and a string description of the field.
May also return a HashRef with field names as keys and a HashRef as a value. Those key/value pairs will be returned to the lookup() function.
lookup()
eris::role::dictionary, eris::dictionary, eris::dictionary::cee
Brad Lhotsky <brad@divisionbyzero.net>
This software is Copyright (c) 2015 by Brad Lhotsky.
This is free software, licensed under:
The (three-clause) BSD License
To install eris, copy and paste the appropriate command in to your terminal.
cpanm
cpanm eris
CPAN shell
perl -MCPAN -e shell install eris
For more information on module installation, please visit the detailed CPAN module installation guide.