Class: WeatherWeasel::Location

Inherits:
Object
  • Object
show all
Defined in:
lib/weather_weasel/location.rb

Instance Method Summary collapse

Constructor Details

#initialize(city, state, scale = "imperial") ⇒ Location

Returns a new instance of Location.



4
5
6
7
8
9
# File 'lib/weather_weasel/location.rb', line 4

def initialize(city, state, scale = "imperial")
  @city = city
  @state = state
  @scale = scale
  @client = Client.new
end

Instance Method Details

#all_highs(scale = @scale) ⇒ Object



88
89
90
# File 'lib/weather_weasel/location.rb', line 88

def all_highs(scale = @scale)
  forecast.all_highs(scale)
end

#all_lows(scale = @scale) ⇒ Object



92
93
94
# File 'lib/weather_weasel/location.rb', line 92

def all_lows(scale = @scale)
  forecast.all_lows(scale)
end

#all_max_wind(scale = @scale) ⇒ Object



96
97
98
# File 'lib/weather_weasel/location.rb', line 96

def all_max_wind(scale = @scale)
  forecast.all_max_wind(scale)
end

#all_snow_allday(scale = @scale) ⇒ Object



120
121
122
# File 'lib/weather_weasel/location.rb', line 120

def all_snow_allday(scale = @scale)
  forecast.all_snow_allday(scale)
end

#all_snow_day(scale = @scale) ⇒ Object



104
105
106
# File 'lib/weather_weasel/location.rb', line 104

def all_snow_day(scale = @scale)
  forecast.all_snow_day(scale)
end

#all_snow_night(scale = @scale) ⇒ Object



116
117
118
# File 'lib/weather_weasel/location.rb', line 116

def all_snow_night(scale = @scale)
  forecast.snow_night(scale)
end

#almanacObject



25
26
27
# File 'lib/weather_weasel/location.rb', line 25

def almanac
  @almanac ||= Almanac.new(@city, @state, @scale, @client)
end

#almanac_rawObject

Almanac method



21
22
23
# File 'lib/weather_weasel/location.rb', line 21

def almanac_raw
  almanac.raw_data
end

#conditionsObject

Condition (specific location method)



30
31
32
# File 'lib/weather_weasel/location.rb', line 30

def conditions
  @conditions ||= Conditions.new(@city, @state, @scale, @client)
end

#current_hurricaneObject

current Hurricane Method



12
13
14
# File 'lib/weather_weasel/location.rb', line 12

def current_hurricane
  @current_hurricane ||= CurrentHurricane.new(@client)
end

#current_hurricane_rawObject



16
17
18
# File 'lib/weather_weasel/location.rb', line 16

def current_hurricane_raw
  current_hurricane.raw_data
end

#day_high(day_index, scale = @scale) ⇒ Object



80
81
82
# File 'lib/weather_weasel/location.rb', line 80

def day_high(day_index, scale = @scale)
  forecast.all_highs(day_index, format)
end

#forecastObject

Forecast Methods



58
59
60
# File 'lib/weather_weasel/location.rb', line 58

def forecast
  @forecast ||= Forecast.new(@city, @state, @client)
end

#forecast_condition(day_index) ⇒ Object



39
40
41
# File 'lib/weather_weasel/location.rb', line 39

def forecast_condition(day_index)
  forecast.forecast_condition(day_index)
end

#forecast_conditionsObject

Forecast_conditions Methods



35
36
37
# File 'lib/weather_weasel/location.rb', line 35

def forecast_conditions
  forecast.forecast_conditions
end

#forecast_rawObject



62
63
64
# File 'lib/weather_weasel/location.rb', line 62

def forecast_raw
  forecast.raw_data
end

#high(scale = @scale) ⇒ Object

Temperature Methods



76
77
78
# File 'lib/weather_weasel/location.rb', line 76

def high(scale = @scale)
  forecast.high(scale)
end

#highest_snow_day(scale = @scale) ⇒ Object



112
113
114
# File 'lib/weather_weasel/location.rb', line 112

def highest_snow_day(scale = @scale)
  forecast.highest_snow_day(scale)
end

#low(scale = @scale) ⇒ Object



84
85
86
# File 'lib/weather_weasel/location.rb', line 84

def low(scale = @scale)
  forecast.low(scale)     
end

#max_wind(scale = @scale) ⇒ Object



100
101
102
# File 'lib/weather_weasel/location.rb', line 100

def max_wind(scale = @scale)
  forecast.max_wind(scale)
end

#pop(day_index) ⇒ Object

POPS Methods



44
45
46
# File 'lib/weather_weasel/location.rb', line 44

def pop(day_index)
  forecast.pops[day_index]
end

#popsObject



48
49
50
# File 'lib/weather_weasel/location.rb', line 48

def pops
  forecast.pops
end

#qpf_alldays(scale = @scale) ⇒ Object

QPF Methods



53
54
55
# File 'lib/weather_weasel/location.rb', line 53

def qpf_alldays(scale = @scale)
  forecast.qpf_alldays(scale)
end

#skyicon(day_index) ⇒ Object



71
72
73
# File 'lib/weather_weasel/location.rb', line 71

def skyicon(day_index)
  forecast.skyicon(day_index)
end

#skyiconsObject

Skyicon Methods



67
68
69
# File 'lib/weather_weasel/location.rb', line 67

def skyicons
  forecast.skyicons
end

#snow_day(day, scale = @scale) ⇒ Object



108
109
110
# File 'lib/weather_weasel/location.rb', line 108

def snow_day(day, scale = @scale)
  forecast.snow_day(day, scale)
end