Sha256: 6cc7664cdb4bf6ece416de6e1f44aca3960fd2239d307d9e751def72be89c28b
Contents?: true
Size: 716 Bytes
Versions: 1
Compression:
Stored size: 716 Bytes
Contents
module OW class Weather 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'] && json['coord']['lon'] @latitude = json['coord'] && 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 |
---|---|
oweather-0.1.0 | lib/OW/weather.rb |