Module: BookingSync::API::Client::Availabilities

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

Instance Method Summary collapse

Instance Method Details

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

List availabilities

Returns availabilities for the rentals of the account, user is authenticated with.

Examples:

Get the list of availabilities for the current account

availabilities = @api.availabilities
availabilities.first.start_date # => "2014-05-30"

Parameters:

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

    A customizable set of options.

Options Hash (options):

  • fields: (Array)

    List of fields to be fetched.

Returns:

See Also:



15
16
17
# File 'lib/bookingsync/api/client/availabilities.rb', line 15

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

#availability(availability) ⇒ BookingSync::API::Resource

Get a single availability

Parameters:

Returns:



24
25
26
# File 'lib/bookingsync/api/client/availabilities.rb', line 24

def availability(availability)
  get("availabilities/#{availability}").pop
end