Class: WorldTraveler::Continents

Inherits:
Object
  • Object
show all
Defined in:
lib/world_traveler/continents.rb

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, url) ⇒ Continents

Returns a new instance of Continents.



6
7
8
9
10
11
# File 'lib/world_traveler/continents.rb', line 6

def initialize(name, url)
  @name = name
  @url = url
  @highlights = []
  @@all << self
end

Instance Attribute Details

#highlightsObject

Returns the value of attribute highlights.



2
3
4
# File 'lib/world_traveler/continents.rb', line 2

def highlights
  @highlights
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/world_traveler/continents.rb', line 2

def name
  @name
end

#urlObject

Returns the value of attribute url.



2
3
4
# File 'lib/world_traveler/continents.rb', line 2

def url
  @url
end

Class Method Details

.allObject



13
14
15
16
# File 'lib/world_traveler/continents.rb', line 13

def self.all
    WorldTraveler::Scraper.scrape_continents if @@all.empty?
    @@all
end

Instance Method Details

#get_highlightsObject



18
19
20
21
# File 'lib/world_traveler/continents.rb', line 18

def get_highlights
    WorldTraveler::Scraper.scrape_highlights(self) if @highlights.empty?
#   binding.pry
end