Class: SimpleOpenWeatherMap::Config
- Inherits:
-
Object
- Object
- SimpleOpenWeatherMap::Config
- Defined in:
- lib/simple_open_weather_map/config.rb
Instance Attribute Summary collapse
-
#app_id ⇒ Object
Returns the value of attribute app_id.
-
#city_id ⇒ Object
Returns the value of attribute city_id.
-
#forecast_days ⇒ Object
Returns the value of attribute forecast_days.
-
#save_icon_dir ⇒ Object
Returns the value of attribute save_icon_dir.
-
#unit ⇒ Object
Returns the value of attribute unit.
Instance Method Summary collapse
-
#initialize(config = {}) ⇒ Config
constructor
A new instance of Config.
- #save_icon? ⇒ Boolean
Constructor Details
#initialize(config = {}) ⇒ Config
Returns a new instance of Config.
6 7 8 9 10 11 |
# File 'lib/simple_open_weather_map/config.rb', line 6 def initialize(config = {}) raise "Hash only." unless config.is_a?(Hash) validate(config) parse(default_config.merge(config)) end |
Instance Attribute Details
#app_id ⇒ Object
Returns the value of attribute app_id.
4 5 6 |
# File 'lib/simple_open_weather_map/config.rb', line 4 def app_id @app_id end |
#city_id ⇒ Object
Returns the value of attribute city_id.
4 5 6 |
# File 'lib/simple_open_weather_map/config.rb', line 4 def city_id @city_id end |
#forecast_days ⇒ Object
Returns the value of attribute forecast_days.
4 5 6 |
# File 'lib/simple_open_weather_map/config.rb', line 4 def forecast_days @forecast_days end |
#save_icon_dir ⇒ Object
Returns the value of attribute save_icon_dir.
4 5 6 |
# File 'lib/simple_open_weather_map/config.rb', line 4 def save_icon_dir @save_icon_dir end |
#unit ⇒ Object
Returns the value of attribute unit.
4 5 6 |
# File 'lib/simple_open_weather_map/config.rb', line 4 def unit @unit end |
Instance Method Details
#save_icon? ⇒ Boolean
13 14 15 |
# File 'lib/simple_open_weather_map/config.rb', line 13 def save_icon? @save_icon || false end |