Class: City

Inherits:
Object
  • Object
show all
Defined in:
lib/undercover_tourist_cli/city.rb

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = nil) ⇒ City

Returns a new instance of City.



7
8
9
10
11
# File 'lib/undercover_tourist_cli/city.rb', line 7

def initialize(name = nil)
  @name = name.capitalize
  @attractions = []
  @@all << self
end

Instance Attribute Details

#attractionsObject

Returns the value of attribute attractions.



3
4
5
# File 'lib/undercover_tourist_cli/city.rb', line 3

def attractions
  @attractions
end

#city_summaryObject

Returns the value of attribute city_summary.



3
4
5
# File 'lib/undercover_tourist_cli/city.rb', line 3

def city_summary
  @city_summary
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/undercover_tourist_cli/city.rb', line 3

def name
  @name
end

#urlsObject

Returns the value of attribute urls.



3
4
5
# File 'lib/undercover_tourist_cli/city.rb', line 3

def urls
  @urls
end

Class Method Details

.allObject



13
14
15
# File 'lib/undercover_tourist_cli/city.rb', line 13

def self.all 
  @@all 
end