class SnowReport::Mountains
Attributes
base_depth[RW]
link[RW]
name[RW]
runs_open[RW]
snowfall[RW]
state[RW]
Public Class Methods
all()
click to toggle source
# File lib/snow_report/mountains.rb, line 9 def self.all @@all end
find_all_in_state(state)
click to toggle source
# File lib/snow_report/mountains.rb, line 21 def self.find_all_in_state(state) states_resorts = SnowReport::Mountains.all.select {|obj| obj.state.downcase == state} if states_resorts.size == 0 return nil end states_resorts end
find_resort(resort)
click to toggle source
# File lib/snow_report/mountains.rb, line 29 def self.find_resort(resort) SnowReport::Mountains.all.detect {|obj| obj.name.downcase == resort} end
new(attributes)
click to toggle source
# File lib/snow_report/mountains.rb, line 4 def initialize(attributes) attributes.each {|key, value| self.send("#{key}=", value)} @@all << self end
new_by_attributes(hash)
click to toggle source
# File lib/snow_report/mountains.rb, line 13 def self.new_by_attributes(hash) SnowReport::Mountains.new(hash) end
new_by_collection(array)
click to toggle source
# File lib/snow_report/mountains.rb, line 17 def self.new_by_collection(array) array.each {|hash| self.new_by_attributes(hash)} end