Sha256: c708fc3ce7ce81d67434b16926f001454c93138b2f716c8b934f988b701a70fb

Contents?: true

Size: 762 Bytes

Versions: 1

Compression:

Stored size: 762 Bytes

Contents

module Weather
  class Units
    FAHRENHEIT = 'f'
    CELSIUS   = 'c'

    # the unit in which temperature is measured
    # e.g. F for Fahrenheit, and C for Celsius
    attr_reader :temperature

    # the unit in which distance is measured
    # e.g. mi for miles, and km for kilometers
    attr_reader :distance

    # the unit in which pressure is measured
    # e.g in for inches, and cm for centimeters
    attr_reader :pressure

    # the unit in which speed is measured
    # e.g. mph for miles per hour, and kph for kilometers per hour
    attr_reader :speed

    def initialize(payload)
      @temperature = payload[:temperature]
      @distance = payload[:distance]
      @pressure = payload[:pressure]
      @speed = payload[:speed]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
weather-api-1.2.0 lib/weather-api/units.rb