Parent

Class Index [+]

Quicksearch

RR::WildcardMatchers::HashIncluding

Attributes

expected_hash[R]

Public Class Methods

new(expected_hash) click to toggle source
   # File lib/rr/wildcard_matchers/hash_including.rb, line 6
6:       def initialize(expected_hash)
7:         @expected_hash = expected_hash.clone
8:       end

Public Instance Methods

==(other) click to toggle source
    # File lib/rr/wildcard_matchers/hash_including.rb, line 22
22:       def ==(other)
23:         return false unless other.is_a?(self.class)
24:         self.expected_hash == other.expected_hash
25:       end
Also aliased as: eql?
eql?(other) click to toggle source
Alias for: ==
inspect() click to toggle source
    # File lib/rr/wildcard_matchers/hash_including.rb, line 18
18:       def inspect
19:         "hash_including(#{expected_hash.inspect})"
20:       end
wildcard_match?(other) click to toggle source
    # File lib/rr/wildcard_matchers/hash_including.rb, line 10
10:       def wildcard_match?(other)
11:         return true if self == other
12:         expected_hash.each_pair do |key, value|
13:           return false unless other.has_key?(key) && other[key] == expected_hash[key]
14:         end
15:         return true
16:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.