lab42_ihash
A Hash with Business Logic ( call it intelligent ).
Actually it is a view layer over a Hash like object, which needs to obey the simple protocol
Hash#fetch
.
The services IHash
provides are of the number of four:
- Default values per key.
- Validation via Constraints.
- Business Logic or Lookup Logic.
- Caching of Computed Values.
Installation
gem install lab42_ihash --pre
Usage
require 'lab42/ihash'
IHash = Lab42::IHash
Or to do the same in one line of code
require 'lab42/ihash/auto_import'