Module: Chemistry::Temperature

Defined in:
lib/chemistry/temperature.rb,
lib/chemistry/temperature/unit.rb,
lib/chemistry/temperature/errors.rb,
lib/chemistry/temperature/kelvin.rb,
lib/chemistry-temperature/version.rb,
lib/chemistry/temperature/celsius.rb,
lib/chemistry/temperature/fahrenheit.rb,
lib/chemistry/temperature/parsed_expression.rb

Defined Under Namespace

Classes: Celsius, Error, Fahrenheit, Kelvin, MalformedInputError, ParsedExpression, Unit

Constant Summary collapse

VERSION =
"1.0.1"

Class Method Summary collapse

Class Method Details

.celsius(temperature) ⇒ Object



14
15
16
# File 'lib/chemistry/temperature.rb', line 14

def self.celsius(temperature)
  Chemistry::Temperature::Celsius.new(temperature)
end

.fahrenheit(temperature) ⇒ Object



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

def self.fahrenheit(temperature)
  Chemistry::Temperature::Fahrenheit.new(temperature)
end

.kelvin(temperature) ⇒ Object



10
11
12
# File 'lib/chemistry/temperature.rb', line 10

def self.kelvin(temperature)
  Chemistry::Temperature::Kelvin.new(temperature)
end

.parse(orig_temperature_string) ⇒ Object



5
6
7
8
# File 'lib/chemistry/temperature.rb', line 5

def self.parse(orig_temperature_string)
  expression = Chemistry::Temperature::ParsedExpression.new(orig_temperature_string)
  expression.temperature
end