Class: Freshbooks::API::Estimate

Inherits:
Client
  • Object
show all
Defined in:
lib/freshbooks/api/estimate.rb

Overview

Instance Attribute Summary

Attributes inherited from Client

#api_url, #token

Instance Method Summary collapse

Methods inherited from Client

#call, #hash_to_raw_xml, #initialize, #options, #parse, #post, #to_request, #underscore

Methods included from CRUD

#create, #delete, #get, #list, #update

Methods included from Methods

#callbacks, #categories, #clients, #contractors, #currencies, #default_terms, #email_templates, #estimates, #expenses, #gateways, #invoices, #items, #languages, #payments, #projects, #receipts, #recurring, #reports, #staff, #systems, #tasks, #taxes, #time_entries

Constructor Details

This class inherits a constructor from Freshbooks::Client

Instance Method Details

#accept(params = {}) ⇒ Object

Change an existing estimate's status to “Accepted”.

Parameters:

  • params (Hash) (defaults to: {})

    A hash of params to accept an estimate.


22
23
24
# File 'lib/freshbooks/api/estimate.rb', line 22

def accept(params = {})
  call('estimate.accept', params)
end

#get_pdf(params = {}) ⇒ Object

Returns the specified estimate in PDF format.

Parameters:

  • params (Hash) (defaults to: {})

    A hash of params to get an estimate's PDF.


15
16
17
# File 'lib/freshbooks/api/estimate.rb', line 15

def get_pdf(params = {})
  call('estimate.getPDF', params)
end

#mark_as_sent(params = {}) ⇒ Object

Move a draft estimate into “Sent” status without issuing the estimate.

Parameters:

  • params (Hash) (defaults to: {})

    A hash of params to mark a draft estimate as sent.


29
30
31
# File 'lib/freshbooks/api/estimate.rb', line 29

def mark_as_sent(params = {})
  call('markAsSent', params)
end

#send_by_email(params = {}) ⇒ Object

Send an estimate to the associated client via e-mail.

Parameters:

  • params (Hash) (defaults to: {})

    A hash of params to send an estimate via email.


8
9
10
# File 'lib/freshbooks/api/estimate.rb', line 8

def send_by_email(params = {})
  call('estimate.sendByEmail', params)
end