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
18
19
# File 'lib/ecu/labels/value_comparison.rb', line 9

def eql?
  return false unless @left.class == @right.class
  case @left
  when NilClass then @left == @right
  when String   then @left == @right
  when Numeric  then @left == @right
  when Array    then arrays_eql?(@left, @right)
  else
    fail "Unkown value class: #{@left.class}"
  end
end