Class: BalboaParkItineraryIdeas::Itinerary

Inherits:
Object
  • Object
show all
Defined in:
lib/balboa_park_itinerary_ideas/itinerary.rb

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#attractionsObject

an array of hashes with names, descriptions, and URLs of the attractions



2
3
4
# File 'lib/balboa_park_itinerary_ideas/itinerary.rb', line 2

def attractions
  @attractions
end

#summaryObject

an array of hashes with names, descriptions, and URLs of the attractions



2
3
4
# File 'lib/balboa_park_itinerary_ideas/itinerary.rb', line 2

def summary
  @summary
end

#titleObject

an array of hashes with names, descriptions, and URLs of the attractions



2
3
4
# File 'lib/balboa_park_itinerary_ideas/itinerary.rb', line 2

def title
  @title
end

#urlObject

an array of hashes with names, descriptions, and URLs of the attractions



2
3
4
# File 'lib/balboa_park_itinerary_ideas/itinerary.rb', line 2

def url
  @url
end

Class Method Details

.allObject



6
7
8
# File 'lib/balboa_park_itinerary_ideas/itinerary.rb', line 6

def self.all
  @@all
end

.find(id) ⇒ Object

returns the itinerary that matches the user input



15
16
17
# File 'lib/balboa_park_itinerary_ideas/itinerary.rb', line 15

def self.find(id)
  self.all[id-1]
end

Instance Method Details

#saveObject



10
11
12
# File 'lib/balboa_park_itinerary_ideas/itinerary.rb', line 10

def save
  @@all << self
end