Class: WeatherInfo::Weather
- Inherits:
-
ActiveApi::ApiObject
- Object
- ActiveApi::ApiObject
- WeatherInfo::Weather
- Includes:
- WeatherMethods
- Defined in:
- lib/weather_by_ip/weather.rb
Instance Attribute Summary collapse
-
#current_conditions ⇒ Object
readonly
Returns the value of attribute current_conditions.
-
#forecast_conditions ⇒ Object
readonly
Returns the value of attribute forecast_conditions.
-
#forecast_information ⇒ Object
readonly
Returns the value of attribute forecast_information.
Instance Method Summary collapse
Methods included from WeatherMethods
Instance Attribute Details
#current_conditions ⇒ Object (readonly)
Returns the value of attribute current_conditions.
68 69 70 |
# File 'lib/weather_by_ip/weather.rb', line 68 def current_conditions @current_conditions end |
#forecast_conditions ⇒ Object (readonly)
Returns the value of attribute forecast_conditions.
68 69 70 |
# File 'lib/weather_by_ip/weather.rb', line 68 def forecast_conditions @forecast_conditions end |
#forecast_information ⇒ Object (readonly)
Returns the value of attribute forecast_information.
68 69 70 |
# File 'lib/weather_by_ip/weather.rb', line 68 def forecast_information @forecast_information end |
Instance Method Details
#==(other_weather) ⇒ Object
81 82 83 84 |
# File 'lib/weather_by_ip/weather.rb', line 81 def ==(other_weather) return false if other_weather.nil? self.forecast_information == other_weather.forecast_information && self.current_conditions != nil && other_weather.current_conditions != nil && self.forecast_conditions.size == other_weather.forecast_conditions.size end |
#inspect ⇒ Object
77 78 79 |
# File 'lib/weather_by_ip/weather.rb', line 77 def inspect "#{@forecast_information} \n\t#{@current_conditions} \n\t#{@forecast_conditions.instance_of?(Array) ? (@forecast_conditions.inject('') {|str, e| (str + e.inspect + "\n\t")}) : @forecast_conditions}" end |