Class: Ramcrest::SuchThat::Matcher

Inherits:
Object
  • Object
show all
Includes:
Matcher
Defined in:
lib/ramcrest/such_that.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Matcher

#do_match, #matches?, #mismatch, #success

Constructor Details

#initialize(description, matcher_block) ⇒ Matcher

Returns a new instance of Matcher.



16
17
18
19
20
# File 'lib/ramcrest/such_that.rb', line 16

def initialize(description, matcher_block)
  singleton = class << self; self; end
  singleton.send(:define_method, :matches?, matcher_block)
  @description = description
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



14
15
16
# File 'lib/ramcrest/such_that.rb', line 14

def description
  @description
end