module Forbidium
Filter hashes by setting allowed or forbidden values for specific keys.
hash = { one: 'one', two: 'two' } hash.forbid(one: 'one') # => { two: 'two' } hash.allow(one: 'two') # => { two: 'two' } hash.allow(one: ['one', 'two']) # => { one: 'one', two: 'two' } hash.forbid(one: ['one', 'two']) # => { two: 'two' } hash.allow!(one: 'two') # => { two: 'two' } hash.forbid!(two: 'two') # => {} hash # => {}
Constants
- VERSION