Class: Mal::HashPermittingT

Inherits:
HashT show all
Defined in:
lib/mal.rb

Instance Method Summary collapse

Methods inherited from HashT

#initialize

Methods inherited from OnlyT

#&, #initialize, #|

Constructor Details

This class inherits a constructor from Mal::HashT

Instance Method Details

#===(value) ⇒ Object



156
157
158
159
160
161
# File 'lib/mal.rb', line 156

def ===(value)
  return false unless super
  permitted = Set.new(@required_keys_to_matchers.keys)
  present = Set.new(value.keys)
  present.subset?(permitted)
end

#inspectObject



163
164
165
# File 'lib/mal.rb', line 163

def inspect
  'HashPermitting(%s)' % @required_keys_to_matchers.inspect[1..-2]
end