Class: MgTracker::Weather
- Inherits:
-
Object
- Object
- MgTracker::Weather
- Defined in:
- lib/mg_tracker/weather.rb
Overview
‘Weather` makes various data about the weather available
Instance Attribute Summary collapse
-
#city ⇒ Object
Returns the value of attribute city.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
-
#state ⇒ Object
Returns the value of attribute state.
Instance Method Summary collapse
-
#initialize(service = WeatherService.new, options = {}) ⇒ Weather
constructor
A new instance of Weather.
Constructor Details
#initialize(service = WeatherService.new, options = {}) ⇒ Weather
Returns a new instance of Weather.
9 10 11 12 13 |
# File 'lib/mg_tracker/weather.rb', line 9 def initialize(service = WeatherService.new, = {}) @service = service @city = service.city = [:city] || 'San Francisco' @state = service.state = [:state] || 'CA' end |
Instance Attribute Details
#city ⇒ Object
Returns the value of attribute city.
6 7 8 |
# File 'lib/mg_tracker/weather.rb', line 6 def city @city end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
7 8 9 |
# File 'lib/mg_tracker/weather.rb', line 7 def service @service end |
#state ⇒ Object
Returns the value of attribute state.
6 7 8 |
# File 'lib/mg_tracker/weather.rb', line 6 def state @state end |