class Forecastr::Temperature

Public Class Methods

new(kelvin) click to toggle source
# File lib/forecastr/temperature.rb, line 4
def initialize(kelvin)
  @kelvin = kelvin
end

Public Instance Methods

to_celsius() click to toggle source
# File lib/forecastr/temperature.rb, line 8
def to_celsius
  TemperatureConverter.to_celsius(@kelvin)
end
to_farenheit() click to toggle source
# File lib/forecastr/temperature.rb, line 12
def to_farenheit
  TemperatureConverter.to_farenheit(@kelvin)
end
to_s() click to toggle source
# File lib/forecastr/temperature.rb, line 16
def to_s
  "#{to_celsius} °C"
end