# File lib/van/units/base.rb, line 142 142: def initialize(name, converter = Units::Converter.current) 143: name = name.to_sym 144: raise ::ArgumentError, "unit #{name.to_s.dump} not registered with #{converter}" if not converter.registered? name 145: @name = name 146: @converter = converter 147: end
# File lib/van/units/base.rb, line 153 153: def ==(other) 154: other.is_a?(Units::BaseUnit) && other.name == @name && other.converter == @converter 155: end
# File lib/van/units/base.rb, line 149 149: def conversion 150: @converter.send(:conversions, @name) 151: end
# File lib/van/units/base.rb, line 159 159: def hash 160: @name.hash ^ @converter.hash 161: end
# File lib/van/units/base.rb, line 163 163: def to_s 164: if Units::Converter.current.includes?(converter) 165: @name.to_s 166: else 167: "#{@converter}:#{@name}" 168: end 169: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.