Class: Muack::Where
- Inherits:
-
Satisfying
- Object
- Struct
- Satisfying
- Muack::Where
- Defined in:
- lib/muack/satisfying.rb
Constant Summary collapse
- None =
Object.new
Instance Attribute Summary
Attributes inherited from Satisfying
Instance Method Summary collapse
-
#initialize(spec) ⇒ Where
constructor
A new instance of Where.
- #match(actual_arg, spec = api_args.first) ⇒ Object
Methods inherited from Satisfying
Constructor Details
#initialize(spec) ⇒ Where
Returns a new instance of Where.
120 121 122 |
# File 'lib/muack/satisfying.rb', line 120 def initialize spec super([spec]) end |
Instance Method Details
#match(actual_arg, spec = api_args.first) ⇒ Object
124 125 126 127 128 129 130 131 132 133 |
# File 'lib/muack/satisfying.rb', line 124 def match actual_arg, spec=api_args.first case spec when Hash actual_arg.kind_of?(Hash) && match_hash(actual_arg, spec) when Array actual_arg.kind_of?(Array) && match_array(actual_arg, spec) else raise UnknownSpec.new(spec) end end |