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, options = {}) ⇒ BookingSync::API::Resource

Create a new review



38
39
40
# File 'lib/bookingsync/api/client/reviews.rb', line 38

def create_review(booking, options = {})
  post("bookings/#{booking}/reviews", reviews: [options]).pop
end

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

Get a single review

Options Hash (options):

  • fields: (Array)

    List of fields to be fetched.



28
29
30
# File 'lib/bookingsync/api/client/reviews.rb', line 28

def review(review, options = {})
  get("reviews/#{review}", 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])

Options Hash (options):

  • fields: (Array)

    List of fields to be fetched.

See Also:



17
18
19
# File 'lib/bookingsync/api/client/reviews.rb', line 17

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