Class: Leftovers::Matchers::Any
- Inherits:
-
Object
- Object
- Leftovers::Matchers::Any
- Includes:
- ComparableInstance
- Defined in:
- lib/leftovers/matchers/any.rb
Instance Attribute Summary collapse
-
#matchers ⇒ Object
readonly
Returns the value of attribute matchers.
Instance Method Summary collapse
- #===(value) ⇒ Object
-
#initialize(matchers) ⇒ Any
constructor
A new instance of Any.
Methods included from ComparableInstance
Constructor Details
#initialize(matchers) ⇒ Any
Returns a new instance of Any.
10 11 12 13 14 |
# File 'lib/leftovers/matchers/any.rb', line 10 def initialize(matchers) @matchers = matchers freeze end |
Instance Attribute Details
#matchers ⇒ Object (readonly)
Returns the value of attribute matchers.
8 9 10 |
# File 'lib/leftovers/matchers/any.rb', line 8 def matchers @matchers end |
Instance Method Details
#===(value) ⇒ Object
16 17 18 19 20 |
# File 'lib/leftovers/matchers/any.rb', line 16 def ===(value) @matchers.any? do |matcher| matcher === value end end |