Method: Quantify::Unit::Base.configure
- Defined in:
- lib/quantify/unit/base_unit.rb
.configure(&block) ⇒ Object
Syntactic sugar for defining the units known to the system, enabling the required associated units to be loaded at runtime, e.g.
Unit::[Base|SI|NonSI].configure do |config|
load :name => :metre, :physical_quantity => :length
load :name => 'hectare', :physical_quantity => :area, :factor => 10000
load :name => :watt, :physical_quantity => :power, :symbol => 'W'
end
70 71 72 |
# File 'lib/quantify/unit/base_unit.rb', line 70 def self.configure(&block) class_eval(&block) if block end |