Class: Logbook::TaskEntry
- Inherits:
-
Struct
- Object
- Struct
- Logbook::TaskEntry
- Defined in:
- lib/logbook/task_entry.rb
Constant Summary collapse
- DATE_PROPERTY_NAME =
"Date"
Instance Attribute Summary collapse
-
#line_number ⇒ Object
Returns the value of attribute line_number.
-
#note ⇒ Object
Returns the value of attribute note.
-
#properties ⇒ Object
Returns the value of attribute properties.
-
#status ⇒ Object
Returns the value of attribute status.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#time ⇒ Object
Returns the value of attribute time.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #merge_page_properties(properties) ⇒ Object
- #recorded_at ⇒ Object
- #starts_clock? ⇒ Boolean
- #stops_clock? ⇒ Boolean
Instance Attribute Details
#line_number ⇒ Object
Returns the value of attribute line_number
4 5 6 |
# File 'lib/logbook/task_entry.rb', line 4 def line_number @line_number end |
#note ⇒ Object
Returns the value of attribute note
4 5 6 |
# File 'lib/logbook/task_entry.rb', line 4 def note @note end |
#properties ⇒ Object
Returns the value of attribute properties
4 5 6 |
# File 'lib/logbook/task_entry.rb', line 4 def properties @properties end |
#status ⇒ Object
Returns the value of attribute status
4 5 6 |
# File 'lib/logbook/task_entry.rb', line 4 def status @status end |
#tags ⇒ Object
Returns the value of attribute tags
4 5 6 |
# File 'lib/logbook/task_entry.rb', line 4 def @tags end |
#time ⇒ Object
Returns the value of attribute time
4 5 6 |
# File 'lib/logbook/task_entry.rb', line 4 def time @time end |
#title ⇒ Object
Returns the value of attribute title
4 5 6 |
# File 'lib/logbook/task_entry.rb', line 4 def title @title end |
Instance Method Details
#merge_page_properties(properties) ⇒ Object
7 8 9 |
# File 'lib/logbook/task_entry.rb', line 7 def merge_page_properties(properties) self.properties = properties.merge(self.properties) end |
#recorded_at ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/logbook/task_entry.rb', line 11 def recorded_at date = self.properties[DATE_PROPERTY_NAME] time = self.time DateTime.parse(date + " " + time) rescue ArgumentError end |
#starts_clock? ⇒ Boolean
19 20 21 |
# File 'lib/logbook/task_entry.rb', line 19 def starts_clock? [Task::START, Task::RESUME, Task::REOPEN].include?(self.status) end |
#stops_clock? ⇒ Boolean
23 24 25 |
# File 'lib/logbook/task_entry.rb', line 23 def stops_clock? true end |