module Alchemist
Constants
- VERSION
Public Class Methods
config()
click to toggle source
# File lib/alchemist.rb, line 37 def self.config @configuration ||= Configuration.new end
library()
click to toggle source
# File lib/alchemist.rb, line 33 def self.library @library ||= Library.new end
measure(value, unit, exponent = 1.0)
click to toggle source
# File lib/alchemist.rb, line 24 def self.measure value, unit, exponent = 1.0 Measurement.new value, unit, exponent end
measure_prefixed(value, prefix, unit)
click to toggle source
# File lib/alchemist.rb, line 28 def self.measure_prefixed value, prefix, unit exponent = library.exponent_for(unit, prefix) Measurement.new value, unit, exponent, prefix: prefix end
register(types, names, value)
click to toggle source
# File lib/alchemist.rb, line 41 def self.register(types, names, value) library.register(types, names, value) end
reset!()
click to toggle source
# File lib/alchemist.rb, line 45 def self.reset! @library = nil @configuration = nil end
setup(category = nil)
click to toggle source
# File lib/alchemist.rb, line 16 def self.setup category = nil if category load_category category else load_all_categories end end
Private Class Methods
load_all_categories()
click to toggle source
# File lib/alchemist.rb, line 52 def self.load_all_categories library.load_all_categories end
load_category(category)
click to toggle source
# File lib/alchemist.rb, line 56 def self.load_category category library.load_category(category) end