Class: Chemistry::Temperature::Kelvin
- Inherits:
-
Unit
- Object
- Unit
- Chemistry::Temperature::Kelvin
show all
- Defined in:
- lib/chemistry/temperature/kelvin.rb
Instance Method Summary
collapse
Methods inherited from Unit
#initialize, #to_f, #to_i
Instance Method Details
#==(other) ⇒ Object
23
24
25
26
27
28
29
|
# File 'lib/chemistry/temperature/kelvin.rb', line 23
def ==(other)
if other.kind_of? Chemistry::Temperature::Kelvin
to_f == other.to_f
else
false
end
end
|
#convert_to_celsius ⇒ Object
19
20
21
|
# File 'lib/chemistry/temperature/kelvin.rb', line 19
def convert_to_celsius
@temperature - 273.15
end
|
#to_fahrenheit ⇒ Object
15
16
17
|
# File 'lib/chemistry/temperature/kelvin.rb', line 15
def to_fahrenheit
to_celsius.to_fahrenheit
end
|
#to_kelvin ⇒ Object
7
8
9
|
# File 'lib/chemistry/temperature/kelvin.rb', line 7
def to_kelvin
self
end
|