Class: Fakes::BlockArgMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/fakes/arg_matching/block_arg_matcher.rb

Instance Method Summary collapse

Constructor Details

#initialize(specification_block) ⇒ BlockArgMatcher

Returns a new instance of BlockArgMatcher.



4
5
6
# File 'lib/fakes/arg_matching/block_arg_matcher.rb', line 4

def initialize(specification_block)
  @specification_block = specification_block
end

Instance Method Details

#matches?(item) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/fakes/arg_matching/block_arg_matcher.rb', line 8

def matches?(item)
  @specification_block.call(item)
end