Method: Quantify::Unit::NonSI#initialize
- Defined in:
- lib/quantify/unit/non_si_unit.rb
#initialize(options = nil) ⇒ NonSI
Additional initialize. Some NonSI units - temperature units, celsius and farenheit - contain scaling factors in addition to multiplicative factors. These are required in order to perform conversion, e.g. kelvin => celsius and therefore become and additional attribute to NonSI units
13 14 15 16 17 18 19 |
# File 'lib/quantify/unit/non_si_unit.rb', line 13 def initialize(=nil) @scaling = 0.0 if .is_a?(Hash) && [:scaling] @scaling = .delete(:scaling).to_f end super() end |