class Measurement::Unit::Builder
Public Class Methods
new(unit_name, &block)
click to toggle source
# File lib/ruby-measurement/unit.rb, line 72 def initialize(unit_name, &block) @unit = Unit.new(unit_name) block.call(self) if block_given? end
Public Instance Methods
alias(*args)
click to toggle source
# File lib/ruby-measurement/unit.rb, line 77 def alias(*args) @unit.add_alias(*args) end
convert_to(unit_name, &block)
click to toggle source
# File lib/ruby-measurement/unit.rb, line 81 def convert_to(unit_name, &block) @unit.add_conversion(unit_name, &block) end
to_unit()
click to toggle source
# File lib/ruby-measurement/unit.rb, line 85 def to_unit @unit end