Module: BookingSync::API::Client::RentalsFees

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

Instance Method Summary collapse

Instance Method Details

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

Create a new rentals_fee

Parameters:

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

    Rental or ID of the rental for which rentals_fee will be created.

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

    RentalsFee’s attributes.

Returns:



38
39
40
# File 'lib/bookingsync/api/client/rentals_fees.rb', line 38

def create_rentals_fee(rental, options = {})
  post("rentals/#{rental}/rentals_fees", rentals_fees: [options]).pop
end

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

Get a single rentals_fee

Parameters:

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

    RentalsFee or ID of the rentals_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/rentals_fees.rb', line 28

def rentals_fee(rentals_fee, options = {})
  get("rentals_fees/#{rentals_fee}", options).pop
end

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

List rentals fees

Returns rentals fees for the account user is authenticated with.

Examples:

Get the list of rentals fees for the current account

rentals_fees = @api.rentals fees
rentals_fees.first.always_applied # => true

Get the list of rentals fees only with start_date and end_date for smaller response

@api.rentals fees(fields: [:start_date, :end_date])

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

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