Class: Ecu::ValueComparison

Inherits:
Object
  • Object
show all
Defined in:
lib/ecu/labels/value_comparison.rb

Instance Method Summary collapse

Constructor Details

#initialize(left, right) ⇒ ValueComparison

Returns a new instance of ValueComparison.



4
5
6
7
# File 'lib/ecu/labels/value_comparison.rb', line 4

def initialize(left, right)
  # check_compatibility(left, right)
  @left, @right = left, right
end

Instance Method Details

#eql?Boolean

Returns:

  • (Boolean)


9
10
11
12
13
14
15
16
17
# File 'lib/ecu/labels/value_comparison.rb', line 9

def eql?
  case [@left, @right]
  in [NilClass, NilClass] then @left == @right
  in [String, String]     then @left == @right
  in [Numeric, Numeric]   then @left == @right
  in [Array, Array]       then arrays_eql?(@left, @right)
  in [_, _]               then false
  end
end