Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Also you can get some data on the gem response:
* Clouds
* Wind speed
* Wind angle
* Sunrise Time
* Sunset Time

You can get your APP ID from the OpenWeatherMap website.

Expand Down Expand Up @@ -90,4 +92,3 @@ Contributors:
## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

8 changes: 5 additions & 3 deletions lib/openweather2/weather.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module Openweather2
class Weather

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

def initialize(json)
@city = json['name']
Expand All @@ -16,6 +16,8 @@ def initialize(json)
@clouds = json['clouds']['all']
@wind_speed = json['wind']['speed']
@wind_angle = json['wind']['deg']
@sunrise = Time.at(json['sys']['sunrise'])
@sunset = Time.at(json['sys']['sunset'])
end
end
end
end