Class: Leftovers::Matchers::And

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ComparableInstance

#eql?, #hash

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

#lhsObject (readonly)

Returns the value of attribute lhs.



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

def lhs
  @lhs
end

#rhsObject (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