Class: Landmarks::Landmark
- Inherits:
-
Object
- Object
- Landmarks::Landmark
- Defined in:
- lib/landmarks/landmark.rb
Constant Summary collapse
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#directions ⇒ Object
Returns the value of attribute directions.
-
#name ⇒ Object
Returns the value of attribute name.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name = nil, url = nil) ⇒ Landmark
constructor
A new instance of Landmark.
Constructor Details
#initialize(name = nil, url = nil) ⇒ Landmark
Returns a new instance of Landmark.
7 8 9 10 11 |
# File 'lib/landmarks/landmark.rb', line 7 def initialize(name=nil, url=nil) @name = name @url = url @@all << self end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/landmarks/landmark.rb', line 3 def description @description end |
#directions ⇒ Object
Returns the value of attribute directions.
3 4 5 |
# File 'lib/landmarks/landmark.rb', line 3 def directions @directions end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/landmarks/landmark.rb', line 3 def name @name end |
#url ⇒ Object
Returns the value of attribute url.
3 4 5 |
# File 'lib/landmarks/landmark.rb', line 3 def url @url end |
Class Method Details
.all ⇒ Object
13 14 15 |
# File 'lib/landmarks/landmark.rb', line 13 def self.all @@all end |
.find(number) ⇒ Object
17 18 19 |
# File 'lib/landmarks/landmark.rb', line 17 def self.find(number) self.all[number - 1] end |
.scraper ⇒ Object
23 24 25 |
# File 'lib/landmarks/landmark.rb', line 23 def self.scraper @@scraper end |