Module: BookingSync::API::Client::Amenities

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

Instance Method Summary collapse

Instance Method Details

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

List amenities

Returns all amenities supported in BookingSync.

Examples:

Get the list of amenities for the current account

amenities = @api.amenities
amenities.first.title # => "Internet"

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/amenities.rb', line 15

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

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

Get a single amenity

Parameters:

Returns:



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

def amenity(amenity)
  get("amenities/#{amenity}").pop
end