Method: Unit#==

Defined in:
lib/unit/class.rb

#==(other) ⇒ Object



108
109
110
111
112
113
114
115
116
# File 'lib/unit/class.rb', line 108

def ==(other)
  if Numeric === other
    other = coerce_numeric(other)
    a, b = self.normalize, other.normalize
    a.value == b.value && a.unit == b.unit
  else
    apply_through_coercion(other, __method__)
  end
end