Class: Landmarks::Landmark

Inherits:
Object
  • Object
show all
Defined in:
lib/landmarks/landmark.rb

Constant Summary collapse

@@all =
[]
@@scraper =
Landmarks::Scraper.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#descriptionObject

Returns the value of attribute description.



3
4
5
# File 'lib/landmarks/landmark.rb', line 3

def description
  @description
end

#directionsObject

Returns the value of attribute directions.



3
4
5
# File 'lib/landmarks/landmark.rb', line 3

def directions
  @directions
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/landmarks/landmark.rb', line 3

def name
  @name
end

#urlObject

Returns the value of attribute url.



3
4
5
# File 'lib/landmarks/landmark.rb', line 3

def url
  @url
end

Class Method Details

.allObject



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

.scraperObject



23
24
25
# File 'lib/landmarks/landmark.rb', line 23

def self.scraper
  @@scraper
end