Method: Convertio::Converter#initialize

Defined in:
lib/convertio.rb

#initialize(value, from, to) ⇒ Converter

Returns a new instance of Converter.



95
96
97
98
99
100
101
102
# File 'lib/convertio.rb', line 95

def initialize(value, from, to)
  @value = value
  @from = from
  @to = to
  @from_unit = UNITS[@from]
  @to_unit = UNITS[@to]
  validate!
end