Class: TopRankedSkiResorts::Resort

Inherits:
Object
  • Object
show all
Defined in:
lib/top_ranked_ski_resorts/resort.rb

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Resort

Returns a new instance of Resort.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/top_ranked_ski_resorts/resort.rb', line 8

def initialize(attributes = {})
	@rank = attributes[:rank]
	@place = attributes[:place]
	@state = attributes[:state]
	@airport = attributes[:airport]
	@score = attributes[:score]
	@acreage = attributes[:acreage]
	@summit_elevation = attributes[:summit_elevation]
	@vertical_drop = attributes[:vertical_drop]
	@lifts = attributes[:lifts]
	@true_snowfall = attributes[:true_snowfall]
	@total_runs = attributes[:total_runs]
	@longest_run = attributes[:longest_run]
	@terrain_parks = attributes[:terrain_parks]
	@halfpipes = attributes[:halfpipes] 
	@protip = attributes[:protip]
	save
end

Instance Attribute Details

#acreageObject

Returns the value of attribute acreage.



3
4
5
# File 'lib/top_ranked_ski_resorts/resort.rb', line 3

def acreage
  @acreage
end

#airportObject

Returns the value of attribute airport.



3
4
5
# File 'lib/top_ranked_ski_resorts/resort.rb', line 3

def airport
  @airport
end

#halfpipesObject

Returns the value of attribute halfpipes.



3
4
5
# File 'lib/top_ranked_ski_resorts/resort.rb', line 3

def halfpipes
  @halfpipes
end

#liftsObject

Returns the value of attribute lifts.



3
4
5
# File 'lib/top_ranked_ski_resorts/resort.rb', line 3

def lifts
  @lifts
end

#longest_runObject

Returns the value of attribute longest_run.



3
4
5
# File 'lib/top_ranked_ski_resorts/resort.rb', line 3

def longest_run
  @longest_run
end

#placeObject

Returns the value of attribute place.



3
4
5
# File 'lib/top_ranked_ski_resorts/resort.rb', line 3

def place
  @place
end

#protipObject

Returns the value of attribute protip.



3
4
5
# File 'lib/top_ranked_ski_resorts/resort.rb', line 3

def protip
  @protip
end

#rankObject

Returns the value of attribute rank.



3
4
5
# File 'lib/top_ranked_ski_resorts/resort.rb', line 3

def rank
  @rank
end

#scoreObject

Returns the value of attribute score.



3
4
5
# File 'lib/top_ranked_ski_resorts/resort.rb', line 3

def score
  @score
end

#stateObject

Returns the value of attribute state.



3
4
5
# File 'lib/top_ranked_ski_resorts/resort.rb', line 3

def state
  @state
end

#summit_elevationObject

Returns the value of attribute summit_elevation.



3
4
5
# File 'lib/top_ranked_ski_resorts/resort.rb', line 3

def summit_elevation
  @summit_elevation
end

#terrain_parksObject

Returns the value of attribute terrain_parks.



3
4
5
# File 'lib/top_ranked_ski_resorts/resort.rb', line 3

def terrain_parks
  @terrain_parks
end

#total_runsObject

Returns the value of attribute total_runs.



3
4
5
# File 'lib/top_ranked_ski_resorts/resort.rb', line 3

def total_runs
  @total_runs
end

#true_snowfallObject

Returns the value of attribute true_snowfall.



3
4
5
# File 'lib/top_ranked_ski_resorts/resort.rb', line 3

def true_snowfall
  @true_snowfall
end

#vertical_dropObject

Returns the value of attribute vertical_drop.



3
4
5
# File 'lib/top_ranked_ski_resorts/resort.rb', line 3

def vertical_drop
  @vertical_drop
end

Class Method Details

.allObject



27
28
29
# File 'lib/top_ranked_ski_resorts/resort.rb', line 27

def self.all
	@@all
end

Instance Method Details

#saveObject



31
32
33
# File 'lib/top_ranked_ski_resorts/resort.rb', line 31

def save
	@@all << self
end