Module: BookingSync::API::Client::Fees

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

Instance Method Summary collapse

Instance Method Details

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

Create a new fee

Parameters:

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

    Fee’s attributes.

Returns:



36
37
38
# File 'lib/bookingsync/api/client/fees.rb', line 36

def create_fee(options = {})
  post(:fees, fees: [options]).pop
end

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

Get a single fee

Parameters:

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

    Fee or ID of the fee.

  • 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/fees.rb', line 28

def fee(fee, options = {})
  get("fees/#{fee}", options).pop
end

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

List fees

Returns fees for the account user is authenticated with.

Examples:

Get the list of fees for the current account

fees = @api.fees
fees.first.rate # => 20.0

Get the list of fees only with name and rate for smaller response

@api.fees(fields: [:name, :rate])

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/fees.rb', line 17

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