Class: ThisDayInHistory::Events
- Inherits:
-
Object
- Object
- ThisDayInHistory::Events
- Defined in:
- lib/this_day_in_history/events.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#category ⇒ Object
Returns the value of attribute category.
-
#full_story ⇒ Object
Returns the value of attribute full_story.
-
#link ⇒ Object
Returns the value of attribute link.
-
#story ⇒ Object
Returns the value of attribute story.
-
#title ⇒ Object
Returns the value of attribute title.
-
#year ⇒ Object
Returns the value of attribute year.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Events
constructor
A new instance of Events.
Constructor Details
#initialize ⇒ Events
Returns a new instance of Events.
6 7 8 |
# File 'lib/this_day_in_history/events.rb', line 6 def initialize @@all << self end |
Instance Attribute Details
#category ⇒ Object
Returns the value of attribute category.
2 3 4 |
# File 'lib/this_day_in_history/events.rb', line 2 def category @category end |
#full_story ⇒ Object
Returns the value of attribute full_story.
2 3 4 |
# File 'lib/this_day_in_history/events.rb', line 2 def full_story @full_story end |
#link ⇒ Object
Returns the value of attribute link.
2 3 4 |
# File 'lib/this_day_in_history/events.rb', line 2 def link @link end |
#story ⇒ Object
Returns the value of attribute story.
2 3 4 |
# File 'lib/this_day_in_history/events.rb', line 2 def story @story end |
#title ⇒ Object
Returns the value of attribute title.
2 3 4 |
# File 'lib/this_day_in_history/events.rb', line 2 def title @title end |
#year ⇒ Object
Returns the value of attribute year.
2 3 4 |
# File 'lib/this_day_in_history/events.rb', line 2 def year @year end |
Class Method Details
.all ⇒ Object
10 11 12 |
# File 'lib/this_day_in_history/events.rb', line 10 def self.all @@all end |
.list_by_title ⇒ Object
18 19 20 |
# File 'lib/this_day_in_history/events.rb', line 18 def self.list_by_title @@all.each.with_index(1){|event, i| puts "#{i}. #{event.title} "} end |
.reset_all ⇒ Object
14 15 16 |
# File 'lib/this_day_in_history/events.rb', line 14 def self.reset_all @@all.clear end |