Class: WorkLog

Inherits:
Object
  • Object
show all
Defined in:
lib/work_log.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dateObject (readonly)

Returns the value of attribute date.



4
5
6
# File 'lib/work_log.rb', line 4

def date
  @date
end

#descriptionObject (readonly)

Returns the value of attribute description.



4
5
6
# File 'lib/work_log.rb', line 4

def description
  @description
end

#idObject (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_sObject



12
13
14
# File 'lib/work_log.rb', line 12

def to_s
  "#{@date.strftime('%d/%m/%Y')} - #{@description}"
end