Class: Yweather::Forecast

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/yweather/forecast.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils

#parse_time

Constructor Details

#initialize(data) ⇒ Forecast

Returns a new instance of Forecast.



12
13
14
15
16
17
18
19
# File 'lib/yweather/forecast.rb', line 12

def initialize (data)
  @day = data[:day]
  @date = parse_time(data[:date])
  @low = data[:low].to_i
  @high = data[:high].to_i
  @text = data[:text]
  @code = data[:code].to_i
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



10
11
12
# File 'lib/yweather/forecast.rb', line 10

def code
  @code
end

#dateObject (readonly)

Returns the value of attribute date.



6
7
8
# File 'lib/yweather/forecast.rb', line 6

def date
  @date
end

#dayObject (readonly)

Returns the value of attribute day.



5
6
7
# File 'lib/yweather/forecast.rb', line 5

def day
  @day
end

#highObject (readonly)

Returns the value of attribute high.



8
9
10
# File 'lib/yweather/forecast.rb', line 8

def high
  @high
end

#lowObject (readonly)

Returns the value of attribute low.



7
8
9
# File 'lib/yweather/forecast.rb', line 7

def low
  @low
end

#textObject (readonly)

Returns the value of attribute text.



9
10
11
# File 'lib/yweather/forecast.rb', line 9

def text
  @text
end