Module: Unitwise
- Defined in:
- lib/unitwise.rb,
lib/unitwise/atom.rb,
lib/unitwise/base.rb,
lib/unitwise/term.rb,
lib/unitwise/unit.rb,
lib/unitwise/scale.rb,
lib/unitwise/errors.rb,
lib/unitwise/prefix.rb,
lib/unitwise/version.rb,
lib/unitwise/compound.rb,
lib/unitwise/standard.rb,
lib/unitwise/compatible.rb,
lib/unitwise/expression.rb,
lib/unitwise/functional.rb,
lib/unitwise/measurement.rb,
lib/unitwise/expression/parser.rb,
lib/unitwise/expression/matcher.rb,
lib/unitwise/expression/composer.rb,
lib/unitwise/expression/decomposer.rb,
lib/unitwise/expression/transformer.rb
Overview
Unitwise is a library for performing mathematical operations and conversions on all units defined by the [Unified Code for Units of Measure(UCUM).
Defined Under Namespace
Modules: Compatible, Expression, Standard Classes: Atom, Base, Compound, ConversionError, ExpressionError, Functional, Measurement, Prefix, Scale, Term, Unit
Constant Summary collapse
- VERSION =
'0.6.2'
Class Method Summary collapse
-
.data_file(key) ⇒ Object
private
A helper to get the location of a yaml data file.
-
.path ⇒ Object
private
The system path for the installed gem.
-
.search(term) ⇒ Array
Search for available compounds.
Class Method Details
.data_file(key) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
A helper to get the location of a yaml data file
42 43 44 |
# File 'lib/unitwise.rb', line 42 def self.data_file(key) File.join path, 'data', "#{key}.yaml" end |
.path ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The system path for the installed gem
36 37 38 |
# File 'lib/unitwise.rb', line 36 def self.path @path ||= File.dirname(File.dirname(__FILE__)) end |
.search(term) ⇒ Array
Search for available compounds. This is just a helper method for convenience
30 31 32 |
# File 'lib/unitwise.rb', line 30 def self.search(term) Compound.search(term) end |