Class: TimeTally::TimeEntry
- Inherits:
-
Object
- Object
- TimeTally::TimeEntry
- Defined in:
- lib/time_tally/time_entry.rb
Instance Attribute Summary collapse
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#task ⇒ Object
readonly
Returns the value of attribute task.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(task:, duration:) ⇒ TimeEntry
constructor
A new instance of TimeEntry.
- #to_s ⇒ Object
Constructor Details
#initialize(task:, duration:) ⇒ TimeEntry
Returns a new instance of TimeEntry.
5 6 7 8 |
# File 'lib/time_tally/time_entry.rb', line 5 def initialize(task:, duration:) @task = task @duration = duration end |
Instance Attribute Details
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
3 4 5 |
# File 'lib/time_tally/time_entry.rb', line 3 def duration @duration end |
#task ⇒ Object (readonly)
Returns the value of attribute task.
3 4 5 |
# File 'lib/time_tally/time_entry.rb', line 3 def task @task end |
Class Method Details
Instance Method Details
#to_s ⇒ Object
16 17 18 |
# File 'lib/time_tally/time_entry.rb', line 16 def to_s "%-40s %s" % [task, duration] end |