Sha256: 86701b1f7fbea6ec0b9b1fbd309257cb6f5a25644cc4b57f59f4d884cbdf1dbd

Contents?: true

Size: 696 Bytes

Versions: 1

Compression:

Stored size: 696 Bytes

Contents

module Forecastr
  class DataContainer

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

    def initialize(json)
      @city = json['name']
      @longitude = json['coord']['lon']
      @latitude = json['coord']['lat']
      @temperature = json['main']['temp']
      @pressure = json['main']['pressure']
      @humidity = json['main']['humidity']
      @min_temperature = json['main']['temp_min']
      @max_temperature = 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
forecastr-0.1.3 lib/forecastr/data_container.rb