Class: Harvesting::Models::TimeEntry

Inherits:
HarvestRecord show all
Defined in:
lib/harvesting/models/time_entry.rb

Overview

A time entry record from your Harvest account.

For more information: help.getharvest.com/api-v2/timesheets-api/timesheets/time-entries/

Instance Attribute Summary

Attributes inherited from Base

#attributes, #harvest_client

Instance Method Summary collapse

Methods inherited from HarvestRecord

#create, #save, #update

Methods inherited from Base

#create, #delete, #fetch, get, #initialize, #save, #update

Constructor Details

This class inherits a constructor from Harvesting::Models::Base

Instance Method Details

#pathObject



36
37
38
# File 'lib/harvesting/models/time_entry.rb', line 36

def path
  @attributes['id'].nil? ? "time_entries" : "time_entries/#{@attributes['id']}"
end

#to_hashObject



40
41
42
# File 'lib/harvesting/models/time_entry.rb', line 40

def to_hash
  { project_id: project.id, task_id: task.id, user_id: user.id }.merge(super)
end