Class: Umbrella::Weather

Inherits:
Object
  • Object
show all
Defined in:
lib/Umbrella/weather.rb

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cityObject

Returns the value of attribute city.



2
3
4
# File 'lib/Umbrella/weather.rb', line 2

def city
  @city
end

#rain_percObject

Returns the value of attribute rain_perc.



2
3
4
# File 'lib/Umbrella/weather.rb', line 2

def rain_perc
  @rain_perc
end

#sunriseObject

Returns the value of attribute sunrise.



2
3
4
# File 'lib/Umbrella/weather.rb', line 2

def sunrise
  @sunrise
end

#sunsetObject

Returns the value of attribute sunset.



2
3
4
# File 'lib/Umbrella/weather.rb', line 2

def sunset
  @sunset
end

#temperatureObject

Returns the value of attribute temperature.



2
3
4
# File 'lib/Umbrella/weather.rb', line 2

def temperature
  @temperature
end

#weather_conditionObject

Returns the value of attribute weather_condition.



2
3
4
# File 'lib/Umbrella/weather.rb', line 2

def weather_condition
  @weather_condition
end

#windObject

Returns the value of attribute wind.



2
3
4
# File 'lib/Umbrella/weather.rb', line 2

def wind
  @wind
end

Class Method Details

.allObject



10
11
12
# File 'lib/Umbrella/weather.rb', line 10

def self.all 
  @@all
end

.find_by_city(city) ⇒ Object



14
15
16
# File 'lib/Umbrella/weather.rb', line 14

def self.find_by_city(city)
  self.all.find{|a| a.city == city}
end

Instance Method Details

#saveObject



6
7
8
# File 'lib/Umbrella/weather.rb', line 6

def save
  @@all << self 
end