Class: Event
- Inherits:
-
Object
- Object
- Event
- Defined in:
- lib/event.rb
Overview
An object of this class is representing a historical event.
Instance Attribute Summary collapse
-
#detail ⇒ Object
readonly
Returns the value of attribute detail.
-
#disp_index ⇒ Object
Returns the value of attribute disp_index.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Instance Method Summary collapse
-
#initialize(ev) ⇒ Event
constructor
A new instance of Event.
- #to_s ⇒ Object
Constructor Details
#initialize(ev) ⇒ Event
Returns a new instance of Event.
20 21 22 23 24 25 |
# File 'lib/event.rb', line 20 def initialize(ev) @title = ev[0] @year = ev[1] @detail = ev[2] @disp_index = 0 end |
Instance Attribute Details
#detail ⇒ Object (readonly)
Returns the value of attribute detail.
30 31 32 |
# File 'lib/event.rb', line 30 def detail @detail end |
#disp_index ⇒ Object
Returns the value of attribute disp_index.
31 32 33 |
# File 'lib/event.rb', line 31 def disp_index @disp_index end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
30 31 32 |
# File 'lib/event.rb', line 30 def title @title end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
30 31 32 |
# File 'lib/event.rb', line 30 def year @year end |
Instance Method Details
#to_s ⇒ Object
27 28 29 |
# File 'lib/event.rb', line 27 def to_s str = '' << self.class.name << '{ title=' << @title << ', year=' << @year.to_s << ', detail=' << @detail << ', disp_index=' << @disp_index.to_s << '}' end |