Class | FuzzyHash |
In: |
lib/hashery/fuzzyhash.rb
|
Parent: | Object |
A weird hash with special semantics for regex keys.
This is useful when you want to have a lookup table that can either contain strings or regexes. For instance, you might want a catch all for certain regexes that perform a certain logic.
>> hash = FuzzyHash.new >> hash[/^\d+$/] = 'number' >> hash[/.*/] = 'something' >> hash['chunky'] = 'bacon' >> hash['foo'] = 'vader' >> hash['foo'] << 'vader' >> hash['food'] << 'something' >> hash['123'] << 'number'
Copyright (c) 2009 Joshua Hull
fuzz_test | [W] | |
fuzzies | [R] | |
fuzzies_reverse | [R] | |
fuzzy_hash | [R] | |
hash | [R] | |
hash_reverse | [R] |