Class: WorldTraveler::Highlights
- Inherits:
-
Object
- Object
- WorldTraveler::Highlights
- Defined in:
- lib/world_traveler/highlights.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#continent ⇒ Object
Returns the value of attribute continent.
-
#index ⇒ Object
Returns the value of attribute index.
-
#info ⇒ Object
Returns the value of attribute info.
-
#link ⇒ Object
Returns the value of attribute link.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #add_to_continent ⇒ Object
- #get_highlight_details ⇒ Object
-
#initialize(name, continent, link) ⇒ Highlights
constructor
A new instance of Highlights.
- #save ⇒ Object
Constructor Details
#initialize(name, continent, link) ⇒ Highlights
Returns a new instance of Highlights.
5 6 7 8 9 10 11 12 13 |
# File 'lib/world_traveler/highlights.rb', line 5 def initialize(name, continent, link) @name = name @continent = continent @link = link @info = [] # # notify month about the event add_to_continent save end |
Instance Attribute Details
#continent ⇒ Object
Returns the value of attribute continent.
2 3 4 |
# File 'lib/world_traveler/highlights.rb', line 2 def continent @continent end |
#index ⇒ Object
Returns the value of attribute index.
2 3 4 |
# File 'lib/world_traveler/highlights.rb', line 2 def index @index end |
#info ⇒ Object
Returns the value of attribute info.
2 3 4 |
# File 'lib/world_traveler/highlights.rb', line 2 def info @info end |
#link ⇒ Object
Returns the value of attribute link.
2 3 4 |
# File 'lib/world_traveler/highlights.rb', line 2 def link @link end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/world_traveler/highlights.rb', line 2 def name @name end |
Class Method Details
.all ⇒ Object
15 16 17 |
# File 'lib/world_traveler/highlights.rb', line 15 def self.all @@all end |
Instance Method Details
#add_to_continent ⇒ Object
19 20 21 |
# File 'lib/world_traveler/highlights.rb', line 19 def add_to_continent @continent.highlights << self unless @continent.highlights.include?(self) end |
#get_highlight_details ⇒ Object
23 24 25 |
# File 'lib/world_traveler/highlights.rb', line 23 def get_highlight_details WorldTraveler::Scraper.scrape_info(self) if @info.empty? end |
#save ⇒ Object
27 28 29 |
# File 'lib/world_traveler/highlights.rb', line 27 def save @@all << self end |