Class RR::WildcardMatchers::Satisfy
In: lib/rr/wildcard_matchers/satisfy.rb
Parent: Object

Methods

==   eql?   inspect   new   wildcard_match?  

Attributes

expectation_proc  [R] 

Public Class methods

[Source]

   # File lib/rr/wildcard_matchers/satisfy.rb, line 6
6:       def initialize(expectation_proc)
7:         @expectation_proc = expectation_proc
8:       end

Public Instance methods

[Source]

    # File lib/rr/wildcard_matchers/satisfy.rb, line 19
19:       def ==(other)
20:         return false unless other.is_a?(self.class)
21:         self.expectation_proc == other.expectation_proc
22:       end
eql?(other)

Alias for #==

[Source]

    # File lib/rr/wildcard_matchers/satisfy.rb, line 15
15:       def inspect
16:         "satisfy {block}"
17:       end

[Source]

    # File lib/rr/wildcard_matchers/satisfy.rb, line 10
10:       def wildcard_match?(other)
11:         return true if self == other
12:         !!expectation_proc.call(other)
13:       end

[Validate]