Class: WorldTraveler::Continents
- Inherits:
-
Object
- Object
- WorldTraveler::Continents
- Defined in:
- lib/world_traveler/continents.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#highlights ⇒ Object
Returns the value of attribute highlights.
-
#name ⇒ Object
Returns the value of attribute name.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
- #get_highlights ⇒ Object
-
#initialize(name, url) ⇒ Continents
constructor
A new instance of Continents.
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
#highlights ⇒ Object
Returns the value of attribute highlights.
2 3 4 |
# File 'lib/world_traveler/continents.rb', line 2 def highlights @highlights end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/world_traveler/continents.rb', line 2 def name @name end |
#url ⇒ Object
Returns the value of attribute url.
2 3 4 |
# File 'lib/world_traveler/continents.rb', line 2 def url @url end |
Class Method Details
.all ⇒ Object
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_highlights ⇒ Object
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 |