Class: TimeEntry

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#created_atObject

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_secondsObject

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_timeObject

Returns the value of attribute end_time.



2
3
4
# File 'lib/slimtimercli/entities.rb', line 2

def end_time
  @end_time
end

#idObject

Returns the value of attribute id.



2
3
4
# File 'lib/slimtimercli/entities.rb', line 2

def id
  @id
end

#in_progressObject

Returns the value of attribute in_progress.



2
3
4
# File 'lib/slimtimercli/entities.rb', line 2

def in_progress
  @in_progress
end

#start_timeObject

Returns the value of attribute start_time.



2
3
4
# File 'lib/slimtimercli/entities.rb', line 2

def start_time
  @start_time
end

#tagsObject

Returns the value of attribute tags.



2
3
4
# File 'lib/slimtimercli/entities.rb', line 2

def tags
  @tags
end

#taskObject

Returns the value of attribute task.



2
3
4
# File 'lib/slimtimercli/entities.rb', line 2

def task
  @task
end

#updated_atObject

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

#_serializeObject



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