Class: RR::WildcardMatchers::HashIncluding
- Inherits:
-
Object
- Object
- RR::WildcardMatchers::HashIncluding
- Defined in:
- lib/rr/wildcard_matchers/hash_including.rb
Instance Attribute Summary collapse
-
#expected_hash ⇒ Object
readonly
Returns the value of attribute expected_hash.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
-
#initialize(expected_hash) ⇒ HashIncluding
constructor
A new instance of HashIncluding.
- #inspect ⇒ Object
- #wildcard_match?(other) ⇒ Boolean
Constructor Details
#initialize(expected_hash) ⇒ HashIncluding
Returns a new instance of HashIncluding.
6 7 8 |
# File 'lib/rr/wildcard_matchers/hash_including.rb', line 6 def initialize(expected_hash) @expected_hash = expected_hash.dup end |
Instance Attribute Details
#expected_hash ⇒ Object (readonly)
Returns the value of attribute expected_hash.
4 5 6 |
# File 'lib/rr/wildcard_matchers/hash_including.rb', line 4 def expected_hash @expected_hash end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
19 20 21 22 |
# File 'lib/rr/wildcard_matchers/hash_including.rb', line 19 def ==(other) other.is_a?(self.class) && other.expected_hash == self.expected_hash end |
#inspect ⇒ Object
25 26 27 |
# File 'lib/rr/wildcard_matchers/hash_including.rb', line 25 def inspect "hash_including(#{expected_hash.inspect})" end |