Module: Contracts::Extensions::HashSubsetOf
- Defined in:
- lib/contracts/extensions.rb
Instance Method Summary collapse
Instance Method Details
#normalize_keys ⇒ Object
8 9 10 11 12 13 |
# File 'lib/contracts/extensions.rb', line 8 def normalize_keys self.inject({}) do |normalized, (key, value)| normalized[key.to_s.downcase] = value normalized end end |
#subset_of?(other) ⇒ Boolean
4 5 6 |
# File 'lib/contracts/extensions.rb', line 4 def subset_of?(other) (self.to_a - other.to_a).empty? end |