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