Sha256: 387cffec3631ea03e99a6c5414b3c5e11683044a0108826c3a91a2e06f23f547
Contents?: true
Size: 259 Bytes
Versions: 2
Compression:
Stored size: 259 Bytes
Contents
module Openweather2 class Temperature def initialize(kelvin) @kelvin = kelvin end def to_metric "#{(@kelvin - 273.15).round(2)}°C" end def to_imperial "#{(1.8 * (@kelvin - 273.15) + 32).round(2)}°F" end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
openweather2-0.1.4 | lib/openweather2/temperature.rb |
openweather2-0.1.3 | lib/openweather2/temperature.rb |