Class: OnTheSnow::Resort::Resort
- Inherits:
-
Object
- Object
- OnTheSnow::Resort::Resort
- Defined in:
- lib/onthesnow/resort/resort.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(url) ⇒ Resort
constructor
A new instance of Resort.
- #to_hash ⇒ Object
Methods included from Weather
#condition, #date, #degree, #degree_in_c, #degree_in_f, #weather
Methods included from Snow
#last_24, #last_48, #last_72, #snow
Methods included from Elevation
#elevation, #height_difference, #peak, #valley
Methods included from Slopes
#advanced_slopes, #beginner_slopes, #expert_slopes, #intermediate_slopes, #slopes
Methods included from Lifts
#double_lifts, #fast_quads_lifts, #fast_sixes_lifts, #lifts, #quad_lifts, #surface_lifts, #total_lifts, #trams_lifts, #triple_lifts
Methods included from Info
Constructor Details
Class Method Details
.all ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/onthesnow/resort/resort.rb', line 20 def self.all if @resorts @resorts else @resorts = {} @resorts_count = 0 @api = OnTheSnow::API.instance @api.states.each_value do |state| @api.rss(state["rss"]).items.each do |item| url = @api.build_profile_url_from_snow_resort_url(item.guid) resort = new(url) @resorts[(@resorts_count+=1).to_s] = resort.to_hash #warn "grab #{resort.infos["name"]} => #{resort.inspect}\n" end end @resorts end end |
Instance Method Details
#to_hash ⇒ Object
16 17 18 |
# File 'lib/onthesnow/resort/resort.rb', line 16 def to_hash @hash ||= {"info" => infos, "elevation" => elevation, "lifts" => lifts, "slopes" => slopes, "snow" => snow, "weather" => weather} end |