Class: City
- Inherits:
-
Object
- Object
- City
- Defined in:
- lib/undercover_tourist_cli/city.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#attractions ⇒ Object
Returns the value of attribute attractions.
-
#city_summary ⇒ Object
Returns the value of attribute city_summary.
-
#name ⇒ Object
Returns the value of attribute name.
-
#urls ⇒ Object
Returns the value of attribute urls.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name = nil) ⇒ City
constructor
A new instance of City.
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
#attractions ⇒ Object
Returns the value of attribute attractions.
3 4 5 |
# File 'lib/undercover_tourist_cli/city.rb', line 3 def attractions @attractions end |
#city_summary ⇒ Object
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 |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/undercover_tourist_cli/city.rb', line 3 def name @name end |
#urls ⇒ Object
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
.all ⇒ Object
13 14 15 |
# File 'lib/undercover_tourist_cli/city.rb', line 13 def self.all @@all end |