Class: WorkLog
- Inherits:
-
Object
- Object
- WorkLog
- Defined in:
- lib/work_log.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
-
#initialize(id, date, description) ⇒ WorkLog
constructor
A new instance of WorkLog.
- #to_s ⇒ Object
Constructor Details
#initialize(id, date, description) ⇒ WorkLog
Returns a new instance of WorkLog.
6 7 8 9 10 |
# File 'lib/work_log.rb', line 6 def initialize(id, date, description) @id = id @date = date @description = description end |
Instance Attribute Details
#date ⇒ Object (readonly)
Returns the value of attribute date.
4 5 6 |
# File 'lib/work_log.rb', line 4 def date @date end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
4 5 6 |
# File 'lib/work_log.rb', line 4 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/work_log.rb', line 4 def id @id end |
Instance Method Details
#to_s ⇒ Object
12 13 14 |
# File 'lib/work_log.rb', line 12 def to_s "#{@date.strftime('%d/%m/%Y')} - #{@description}" end |