Class: SportsDataApi::Ncaafb::Weather

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(weather_hash) ⇒ Weather

Returns a new instance of Weather.



5
6
7
8
9
10
11
12
13
# File 'lib/sports_data_api/ncaafb/weather.rb', line 5

def initialize(weather_hash)
  if weather_hash
    @temperature = weather_hash['temperature']
    @condition = weather_hash['condition']
    @humidity = weather_hash['humidity']
    @wind_speed = weather_hash['wind']['speed']
    @wind_direction = weather_hash['wind']['direction']
  end
end

Instance Attribute Details

#conditionObject (readonly)

Returns the value of attribute condition.



4
5
6
# File 'lib/sports_data_api/ncaafb/weather.rb', line 4

def condition
  @condition
end

#humidityObject (readonly)

Returns the value of attribute humidity.



4
5
6
# File 'lib/sports_data_api/ncaafb/weather.rb', line 4

def humidity
  @humidity
end

#temperatureObject (readonly)

Returns the value of attribute temperature.



4
5
6
# File 'lib/sports_data_api/ncaafb/weather.rb', line 4

def temperature
  @temperature
end

#wind_directionObject (readonly)

Returns the value of attribute wind_direction.



4
5
6
# File 'lib/sports_data_api/ncaafb/weather.rb', line 4

def wind_direction
  @wind_direction
end

#wind_speedObject (readonly)

Returns the value of attribute wind_speed.



4
5
6
# File 'lib/sports_data_api/ncaafb/weather.rb', line 4

def wind_speed
  @wind_speed
end