Module: BookingSync::API::Client::Reviews

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

Instance Method Summary collapse

Instance Method Details

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

Create a new review

Parameters:

  • booking_id (Integer) —

    ID of the booking

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

    review attributes

Returns:



26
27
28
# File 'lib/bookingsync/api/client/reviews.rb', line 26

def create_review(booking_id, options = {})
  post(:reviews, booking_id: booking_id, reviews: [options]).pop
end

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

List reviews

Returns reviews for the account user is authenticated with.

Examples:

Get the list of reviews for the current account

reviews = @api.reviews
reviews.first.name # => "John Smith"

Get the list of reviews only with name and comment for smaller response

@api.reviews(fields: [:name, :comment])

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

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