module BookingSync::API::Client::BookingsTags

Public Instance Methods

bookings_tag(bookings_tag, options = {}) click to toggle source

Get a single bookings tag

@param bookings_tag [BookingSync::API::Resource|Integer] BookingsTag or ID

of the bookings tag.

@param options [Hash] A customizable set of query options. @option options [Array] fields: List of fields to be fetched. @return [BookingSync::API::Resource]

# File lib/bookingsync/api/client/bookings_tags.rb, line 28
def bookings_tag(bookings_tag, options = {})
  get("bookings_tags/#{bookings_tag}", options).pop
end
bookings_tags(options = {}, &block) click to toggle source

List bookings tags

Returns bookings tags for the account user is authenticated with. @param options [Hash] A customizable set of options. @option options [Array] fields: List of fields to be fetched. @return [Array<BookingSync::API::Resource>] Array of bookings tags.

@example Get the list of bookings tags for the current account

bookings_tags = @api.bookings_tags
bookings_tags.first.color # => "#6666ff"

@example Get the list of bookings tags only with color for smaller response

@api.bookings_tags(fields: [:color])

@see developers.bookingsync.com/reference/endpoints/bookings_tags/#list-bookings-tags

# File lib/bookingsync/api/client/bookings_tags.rb, line 17
def bookings_tags(options = {}, &block)
  paginate :bookings_tags, options, &block
end