Sha256: 023b9a4c2e989c2109dec3cd8376898f28c7140e50b8bcafa432bb1f1dc166db

Contents?: true

Size: 308 Bytes

Versions: 1

Compression:

Stored size: 308 Bytes

Contents

module Forecastr
  class Temperature

    def initialize(kelvin)
      @kelvin = kelvin
    end

    def to_celsius
      TemperatureConverter.to_celsius(@kelvin)
    end

    def to_farenheit
      TemperatureConverter.to_farenheit(@kelvin)
    end

    def to_s
      "#{to_celsius} °C"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
forecastr-0.1.5 lib/forecastr/temperature.rb