Class: Leftovers::Matchers::All

Inherits:
Object
  • Object
show all
Includes:
ComparableInstance
Defined in:
lib/leftovers/matchers/all.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ComparableInstance

#eql?, #hash

Constructor Details

#initialize(matchers) ⇒ All

Returns a new instance of All.



10
11
12
13
14
# File 'lib/leftovers/matchers/all.rb', line 10

def initialize(matchers)
  @matchers = matchers

  freeze
end

Instance Attribute Details

#matchersObject (readonly)

Returns the value of attribute matchers.



8
9
10
# File 'lib/leftovers/matchers/all.rb', line 8

def matchers
  @matchers
end

Instance Method Details

#===(value) ⇒ Object



16
17
18
19
20
# File 'lib/leftovers/matchers/all.rb', line 16

def ===(value)
  @matchers.all? do |matcher|
    matcher === value
  end
end