Class: Harvesting::Models::Contact

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

Overview

A contact record from your Harvest account.

For more information: help.getharvest.com/api-v2/clients-api/clients/contacts/

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



20
21
22
# File 'lib/harvesting/models/contact.rb', line 20

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

#to_hashObject



24
25
26
# File 'lib/harvesting/models/contact.rb', line 24

def to_hash
  { client_id: client.id }.merge(super)
end