Sha256: cec05d68e4c6de56504ef2a29a17e8e584e78c96bd4c7b356199a90ea8cd7a39

Contents?: true

Size: 804 Bytes

Versions: 1

Compression:

Stored size: 804 Bytes

Contents

module Openweather2
  class Weather

    attr_reader :city, :longitude, :latitude, :pressure, :humidity, :clouds,
      :temperature, :min_temperature, :max_temperature, :wind_speed, :wind_angle, :sunrise, :sunset

    def initialize(json)
      @city = json['name']
      @longitude = json['coord']['lon']
      @latitude = json['coord']['lat']
      @temperature = Openweather2::Temperature.new(json['main']['temp'])
      @pressure = json['main']['pressure']
      @humidity = json['main']['humidity']
      @min_temperature = Openweather2::Temperature.new(json['main']['temp_min'])
      @max_temperature = Openweather2::Temperature.new(json['main']['temp_max'])
      @clouds = json['clouds']['all']
      @wind_speed = json['wind']['speed']
      @wind_angle = json['wind']['deg']
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
openweather2-0.1.3 lib/openweather2/weather.rb