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