Class: Measurement::Unit::Builder
- Inherits:
-
Object
- Object
- Measurement::Unit::Builder
- Defined in:
- lib/ruby-measurement/unit.rb
Instance Method Summary collapse
- #alias(*args) ⇒ Object
- #convert_to(unit_name, &block) ⇒ Object
-
#initialize(unit_name, &block) ⇒ Builder
constructor
A new instance of Builder.
- #to_unit ⇒ Object
Constructor Details
Instance Method Details
#alias(*args) ⇒ Object
77 78 79 |
# File 'lib/ruby-measurement/unit.rb', line 77 def alias(*args) @unit.add_alias(*args) end |
#convert_to(unit_name, &block) ⇒ Object
81 82 83 |
# File 'lib/ruby-measurement/unit.rb', line 81 def convert_to(unit_name, &block) @unit.add_conversion(unit_name, &block) end |
#to_unit ⇒ Object
85 86 87 |
# File 'lib/ruby-measurement/unit.rb', line 85 def to_unit @unit end |