Module: CommerceUnits

Defined in:
lib/commerce_units.rb,
lib/commerce_units/version.rb,
lib/generators/commerce_units/install_generator.rb

Defined Under Namespace

Modules: Generators Classes: Converter, Dimension, Simplifier, TermsReducer, Unit, UnitLexer, UnitParser, Value

Constant Summary collapse

VERSION =
"0.0.5"

Class Method Summary collapse

Class Method Details

.dimensional_databaseObject



15
16
17
# File 'lib/commerce_units.rb', line 15

def self.dimensional_database
  @dimensional_database ||= CommerceUnits::Dimension
end

.dimensional_database=(some_sort_of_class) ⇒ Object



18
19
20
# File 'lib/commerce_units.rb', line 18

def self.dimensional_database=(some_sort_of_class)
  @dimensional_database = some_sort_of_class
end

.nt(number, unit) ⇒ Object



21
22
23
# File 'lib/commerce_units.rb', line 21

def self.nt(number, unit)
  CommerceUnits::Value.from_params number: number, unit: unit
end

.table_name_prefixObject



12
13
14
# File 'lib/commerce_units.rb', line 12

def self.table_name_prefix
  "commerce_units_"
end