Class: NormalizedHash::Matchers::KeyNameMatchers
- Inherits:
-
Object
- Object
- NormalizedHash::Matchers::KeyNameMatchers
- Defined in:
- lib/normalized_hash/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
-
#initialize(expectation) ⇒ KeyNameMatchers
constructor
A new instance of KeyNameMatchers.
Constructor Details
#initialize(expectation) ⇒ KeyNameMatchers
Returns a new instance of KeyNameMatchers.
25 26 27 28 29 |
# File 'lib/normalized_hash/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 |