Class: Deep::Matchers::KeyNameMatchers
- Inherits:
-
Object
- Object
- Deep::Matchers::KeyNameMatchers
- Defined in:
- parser/spec/lib/deep/hash_enclosed_in_array.rb
Overview
Simple class to be inherited by other matcher classes that take String expectation.
Direct Known Subclasses
Instance Method Summary (collapse)
-
- (KeyNameMatchers) initialize(expectation)
constructor
A new instance of KeyNameMatchers.
Constructor Details
- (KeyNameMatchers) initialize(expectation)
A new instance of KeyNameMatchers
25 26 27 28 29 |
# File 'parser/spec/lib/deep/hash_enclosed_in_array.rb', line 25 def initialize(expectation) expectation = expectation.to_s.downcase @expectation = expectation.singularize raise ArgumentError, "#{expectation} must have singular form. Got #{@expectation}" if @expectation == expectation end |