Module: BookingSync::API::Client::BookingsTaxes

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

Instance Method Summary collapse

Instance Method Details

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

Get a single bookings tax

Parameters:

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

    BookingsTax or ID of the bookings 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/bookings_taxes.rb', line 28

def bookings_tax(bookings_tax, options = {})
  get("bookings_taxes/#{bookings_tax}", options).pop
end

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

List bookings taxes

Returns bookings taxes for the account user is authenticated with.

Examples:

Get the list of bookings taxes for the current account

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

Get the list of bookings taxes only with percentage for smaller response

@api.bookings_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/bookings_taxes.rb', line 17

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