Module: BookingSync::API::Client::BookingsTags

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

Instance Method Summary collapse

Instance Method Details

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

Get a single bookings tag

Parameters:

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

    BookingsTag or ID of the bookings tag.

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

def bookings_tag(bookings_tag, options = {})
  get("bookings_tags/#{bookings_tag}", options).pop
end

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

List bookings tags

Returns bookings tags for the account user is authenticated with.

Examples:

Get the list of bookings tags for the current account

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

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

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

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

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