Class: WeatherInfo::Weather

Inherits:
ActiveApi::ApiObject
  • Object
show all
Includes:
WeatherMethods
Defined in:
lib/weather_by_ip/weather.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from WeatherMethods

#get_icon_path, #to_s

Instance Attribute Details

#current_conditionsObject (readonly)

Returns the value of attribute current_conditions.



66
67
68
# File 'lib/weather_by_ip/weather.rb', line 66

def current_conditions
  @current_conditions
end

#forecast_conditionsObject (readonly)

Returns the value of attribute forecast_conditions.



66
67
68
# File 'lib/weather_by_ip/weather.rb', line 66

def forecast_conditions
  @forecast_conditions
end

#forecast_informationObject (readonly)

Returns the value of attribute forecast_information.



66
67
68
# File 'lib/weather_by_ip/weather.rb', line 66

def forecast_information
  @forecast_information
end

Instance Method Details

#==(other_weather) ⇒ Object



79
80
81
82
# File 'lib/weather_by_ip/weather.rb', line 79

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

#inspectObject



75
76
77
# File 'lib/weather_by_ip/weather.rb', line 75

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