Module: BookingSync::API::Client::RentalCancelationPolicies

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

Instance Method Summary collapse

Instance Method Details

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

List rental cancelation policies.

Returns rental cancelation policies for the rentals of the account and account itself user is authenticated with.

Examples:

Get the list of rental cancelation policies for the current account

policy = @api.rental_cancelation_policies
policy.first.body # => "My rental cancelation policy"

Get the list of rental cancelation policies only with body for smaller response

@api.rental_cancelation_policies(fields: :body)

Parameters:

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

    A customizable set of options.

Options Hash (options):

  • fields: (Array)

    List of fields to be fetched.

Returns:

See Also:



18
19
20
# File 'lib/bookingsync/api/client/rental_cancelation_policies.rb', line 18

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

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

Get a single rental cancelation policy

Parameters:

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

    RentalCancelationPolicy or ID of the rental cancelation policy.

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

    A customizable set of query options.

Options Hash (options):

  • fields: (Array)

    List of fields to be fetched.

Returns:



29
30
31
# File 'lib/bookingsync/api/client/rental_cancelation_policies.rb', line 29

def rental_cancelation_policy(rental_cancelation_policy, options = {})
  get("rental_cancelation_policies/#{rental_cancelation_policy}", options).pop
end