module STEMConstants

Constants

Distance
Mass
Number
Time

Public Class Methods

distance(constant, conversion = 'default') click to toggle source
# File lib/STEMConstants.rb, line 72
def self.distance(constant, conversion = 'default')
    Distance[constant.to_sym] / Distance[conversion.to_sym] / Distance[@distance_mode.to_sym]
end
mass(constant, conversion = 'default') click to toggle source
# File lib/STEMConstants.rb, line 80
def self.mass(constant, conversion = 'default')
    Mass[c.to_sym] / Mass[conversion.to_sym] / Mass[@mass_mode.to_sym]
end
number(constant, conversion = 'default') click to toggle source
# File lib/STEMConstants.rb, line 68
def self.number(constant, conversion = 'default')
    Number[constant.to_sym] / Number[conversion.to_sym]
end
set_distance_mode(mode) click to toggle source
# File lib/STEMConstants.rb, line 3
def self.set_distance_mode(mode)
    @distance_mode = mode if Distance[mode.to_sym]
end
set_mass_mode(mode) click to toggle source
# File lib/STEMConstants.rb, line 13
def self.set_mass_mode(mode)
    @mass_mode = mode if Mass[mode.to_sym]
end
set_time_mode(mode) click to toggle source
# File lib/STEMConstants.rb, line 8
def self.set_time_mode(mode)
    @time_mode = mode if Time[mode.to_sym]
end
time(constant, conversion = 'default') click to toggle source
# File lib/STEMConstants.rb, line 76
def self.time(constant, conversion = 'default')
    Time[constant.to_sym] / Time[conversion.to_sym] / Time[@time_mode.to_sym]
end