Class: TimeEntry
- Inherits:
-
Object
- Object
- TimeEntry
- Defined in:
- lib/slimtimercli/entities.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#duration_in_seconds ⇒ Object
Returns the value of attribute duration_in_seconds.
-
#end_time ⇒ Object
Returns the value of attribute end_time.
-
#id ⇒ Object
Returns the value of attribute id.
-
#in_progress ⇒ Object
Returns the value of attribute in_progress.
-
#start_time ⇒ Object
Returns the value of attribute start_time.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#task ⇒ Object
Returns the value of attribute task.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
2 3 4 |
# File 'lib/slimtimercli/entities.rb', line 2 def created_at @created_at end |
#duration_in_seconds ⇒ Object
Returns the value of attribute duration_in_seconds.
2 3 4 |
# File 'lib/slimtimercli/entities.rb', line 2 def duration_in_seconds @duration_in_seconds end |
#end_time ⇒ Object
Returns the value of attribute end_time.
2 3 4 |
# File 'lib/slimtimercli/entities.rb', line 2 def end_time @end_time end |
#id ⇒ Object
Returns the value of attribute id.
2 3 4 |
# File 'lib/slimtimercli/entities.rb', line 2 def id @id end |
#in_progress ⇒ Object
Returns the value of attribute in_progress.
2 3 4 |
# File 'lib/slimtimercli/entities.rb', line 2 def in_progress @in_progress end |
#start_time ⇒ Object
Returns the value of attribute start_time.
2 3 4 |
# File 'lib/slimtimercli/entities.rb', line 2 def start_time @start_time end |
#tags ⇒ Object
Returns the value of attribute tags.
2 3 4 |
# File 'lib/slimtimercli/entities.rb', line 2 def @tags end |
#task ⇒ Object
Returns the value of attribute task.
2 3 4 |
# File 'lib/slimtimercli/entities.rb', line 2 def task @task end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
2 3 4 |
# File 'lib/slimtimercli/entities.rb', line 2 def updated_at @updated_at end |
Class Method Details
._load(hsh) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/slimtimercli/entities.rb', line 6 def self._load(hsh) te = TimeEntry.new hsh.each {|k,v| te.__send__("#{k}=".to_sym, v) if te.respond_to?("#{k}=".to_sym) } end |
Instance Method Details
#_serialize ⇒ Object
13 14 15 16 17 18 |
# File 'lib/slimtimercli/entities.rb', line 13 def _serialize {"time_entry" => { "start_time" => @start_time, "duration_in_seconds" => @duration_in_seconds, "task_id" => @task.id}} end |