Class: TemperatureConvertToKelvin

Inherits:
Object
  • Object
show all
Defined in:
lib/temperature_convert_to_kelvin.rb

Constant Summary collapse

KELVIN =
273.15

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#tempObject (readonly)

Returns the value of attribute temp.



5
6
7
# File 'lib/temperature_convert_to_kelvin.rb', line 5

def temp
  @temp
end

Class Method Details

.to_kelvin(temp) ⇒ Object


converting



11
12
13
# File 'lib/temperature_convert_to_kelvin.rb', line 11

def self.to_kelvin(temp)
  temp.to_f + KELVIN
end