Class: Weather::Wind

Inherits:
Object
  • Object
show all
Defined in:
lib/weather-api/wind.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ Wind

Returns a new instance of Wind.



12
13
14
15
16
# File 'lib/weather-api/wind.rb', line 12

def initialize(payload)
  @chill = payload[:chill].to_i
  @direction = payload[:direction].to_i
  @speed = payload[:speed].to_i
end

Instance Attribute Details

#chillObject (readonly)

the temperature, with wind chill factored in



4
5
6
# File 'lib/weather-api/wind.rb', line 4

def chill
  @chill
end

#directionObject (readonly)

the direction of the wind in degrees



7
8
9
# File 'lib/weather-api/wind.rb', line 7

def direction
  @direction
end

#speedObject (readonly)

the windspeed



10
11
12
# File 'lib/weather-api/wind.rb', line 10

def speed
  @speed
end