Class: Tengu::Matcher

Inherits:
Object
  • Object
show all
Defined in:
lib/tengu/matcher.rb

Direct Known Subclasses

ReceiveMatcher

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(description, &block) ⇒ Matcher

Returns a new instance of Matcher.



4
5
6
7
# File 'lib/tengu/matcher.rb', line 4

def initialize(description, &block)
  @description = description
  @block = block
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



3
4
5
# File 'lib/tengu/matcher.rb', line 3

def description
  @description
end

Instance Method Details

#matches?(object) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/tengu/matcher.rb', line 9

def matches?(object)
  @block.call(object)
end