Class: Unitwise::Prefix
Overview
A prefix can be used with metric atoms to modify their scale.
Class Method Summary collapse
-
.data ⇒ Object
The data loaded from the UCUM spec files.
-
.data_file ⇒ Object
The location of the UCUM spec prefix data file.
Instance Method Summary collapse
-
#scalar=(value) ⇒ Object
Set the scalar value for the prefix, always as a BigDecimal.
Methods inherited from Base
all, find, #names=, #slugs, #to_s
Class Method Details
.data ⇒ Object
The data loaded from the UCUM spec files
8 9 10 |
# File 'lib/unitwise/prefix.rb', line 8 def self.data @data ||= YAML.load File.open(data_file) end |
Instance Method Details
#scalar=(value) ⇒ Object
Set the scalar value for the prefix, always as a BigDecimal
20 21 22 |
# File 'lib/unitwise/prefix.rb', line 20 def scalar=(value) @scalar = BigDecimal(value.to_s) end |