Module: BookingSync::API::Client::Destinations

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

Instance Method Summary collapse

Instance Method Details

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

Get a single destination

Parameters:

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

    Destination or ID of the destination.

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

def destination(destination, options = {})
  get("destinations/#{destination}", options).pop
end

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

List destinations

Returns destinations for the account user is authenticated with.

Examples:

Get the list of destinations for the current account

destinations = @api.destinations
destinations.first.fullname # => {"en":"Europe, World"}

Get the list of destinations only with name and fullname for smaller response

@api.destinations(fields: [:name, :fullname])

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

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