Sha256: 03583dc418496016fd4ebef1e77683745796a24dd9c6393066310a2b9b4847b3
Contents?: true
Size: 711 Bytes
Versions: 2
Compression:
Stored size: 711 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 = 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
openweather2-0.1.2 | lib/openweather2/weather.rb |
openweather2-0.1.1 | lib/openweather2/weather.rb |