Module: BookingSync::API::Client::Taxes

Included in:
BookingSync::API::Client
Defined in:
lib/bookingsync/api/client/taxes.rb

Instance Method Summary collapse

Instance Method Details

#tax(tax, options = {}) ⇒ BookingSync::API::Resource

Get a single tax

Parameters:

  • tax (BookingSync::API::Resource|Integer)

    Tax or ID of the tax.

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

    A customizable set of query options.

Options Hash (options):

  • fields: (Array)

    List of fields to be fetched.

Returns:



28
29
30
# File 'lib/bookingsync/api/client/taxes.rb', line 28

def tax(tax, options = {})
  get("taxes/#{tax}", options).pop
end

#taxes(options = {}, &block) ⇒ Array<BookingSync::API::Resource>

List taxes

Returns taxes for the account user is authenticated with.

Examples:

Get the list of taxes for the current account

taxes = @api.taxes
taxes.first.percentage # => 20.0

Get the list of taxes only with percentage for smaller response

@api.taxes(fields: [:percentage])

Parameters:

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

    A customizable set of options.

Options Hash (options):

  • fields: (Array)

    List of fields to be fetched.

Returns:

See Also:



17
18
19
# File 'lib/bookingsync/api/client/taxes.rb', line 17

def taxes(options = {}, &block)
  paginate :taxes, options, &block
end