Class: Nasty::BlockSpecification

Inherits:
Object
  • Object
show all
Includes:
Specification
Defined in:
lib/nasty/block_specification.rb

Instance Method Summary collapse

Methods included from Specification

#and, #not, #or

Constructor Details

#initialize(&block) ⇒ BlockSpecification

Returns a new instance of BlockSpecification.



27
28
29
# File 'lib/nasty/block_specification.rb', line 27

def initialize(&block)
  @block = block
end

Instance Method Details

#matches?(item) ⇒ Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/nasty/block_specification.rb', line 31

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