Sha256: 2c156b2b8a2fbb0e06308353c4b69dc3806af5bdaec7b67581eb39592a1cd77f

Contents?: true

Size: 727 Bytes

Versions: 4

Compression:

Stored size: 727 Bytes

Contents

module Harvesting
  module Models
    # A contact record from your Harvest account.
    #
    # For more information: https://help.getharvest.com/api-v2/clients-api/clients/contacts/
    class Contact < HarvestRecord
      attributed :id,
                 :title,
                 :first_name,
                 :last_name,
                 :email,
                 :phone_office,
                 :phone_mobile,
                 :fax,
                 :created_at,
                 :updated_at

      modeled client: Client

      def path
        @attributes['id'].nil? ? "contacts" : "contacts/#{@attributes['id']}"
      end
      
      def to_hash
        { client_id: client.id }.merge(super)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
harvesting-0.6.0 lib/harvesting/models/contact.rb
harvesting-0.5.1 lib/harvesting/models/contact.rb
harvesting-0.5.0 lib/harvesting/models/contact.rb
harvesting-0.4.0 lib/harvesting/models/contact.rb