Module: BookingSync::API::Client::BookingComments
- Included in:
- BookingSync::API::Client
- Defined in:
- lib/bookingsync/api/client/booking_comments.rb
Instance Method Summary collapse
-
#booking_comment(booking_comment, options = {}) ⇒ BookingSync::API::Resource
Get a single booking_comment.
-
#booking_comments(options = {}, &block) ⇒ Array<BookingSync::API::Resource>
Returns booking comments for the account and rentals user is authenticated with.
-
#create_booking_comment(booking, options = {}) ⇒ BookingSync::API::Resource
Create new booking_comment for a booking.
-
#delete_booking_comment(booking_comment) ⇒ NilClass
Delete booking_comment.
-
#edit_booking_comment(booking_comment, options = {}) ⇒ BookingSync::API::Resource
Edit a booking_comment.
Instance Method Details
#booking_comment(booking_comment, options = {}) ⇒ BookingSync::API::Resource
Get a single booking_comment
@api.booking_comment(1)
> :links=>{:booking=>10, :id=>1, :content=>“comment 1”, :editable=>true, :created_at=>2016-04-18 12:06:15 UTC, :updated_at=>2016-04-18 12:06:15 UTC}
30 31 32 |
# File 'lib/bookingsync/api/client/booking_comments.rb', line 30 def booking_comment(booking_comment, = {}) get("booking_comments/#{booking_comment}", ).pop end |
#booking_comments(options = {}, &block) ⇒ Array<BookingSync::API::Resource>
Returns booking comments for the account and rentals user is authenticated with.
> [:links=>{:booking=>10, :id=>1, :content=>“comment 1”, :editable=>true, :created_at=>2016-04-18 12:06:15 UTC, :updated_at=>2016-04-18 12:06:15 UTC},
{:links=>{:booking=>11}, :id=>2, :content=>"comment 2", :editable=>true, :created_at=>2016-04-18 12:06:25 UTC, :updated_at=>2016-04-18 12:06:25 UTC}]
> [:links=>{:booking=>10, :id=>1, :content=>“comment 1”, :editable=>true, :created_at=>2016-04-18 12:06:15 UTC, :updated_at=>2016-04-18 12:06:15 UTC}]
18 19 20 |
# File 'lib/bookingsync/api/client/booking_comments.rb', line 18 def booking_comments( = {}, &block) paginate :booking_comments, , &block end |
#create_booking_comment(booking, options = {}) ⇒ BookingSync::API::Resource
Create new booking_comment for a booking
ID of the Booking for which booking_comment will be created @api.create_booking_comment(1, content: “Hello!”)
> :links=>{:booking=>1, :id=>8, :content=>“Hello!”, :editable=>true, :created_at=>2016-04-18 13:31:40 UTC, :updated_at=>2016-04-18 13:46:06 UTC}
43 44 45 |
# File 'lib/bookingsync/api/client/booking_comments.rb', line 43 def create_booking_comment(booking, = {}) post("booking_comments", booking_id: booking, booking_comments: []).pop end |
#delete_booking_comment(booking_comment) ⇒ NilClass
Delete booking_comment
67 68 69 |
# File 'lib/bookingsync/api/client/booking_comments.rb', line 67 def delete_booking_comment(booking_comment) delete "booking_comments/#{booking_comment}" end |
#edit_booking_comment(booking_comment, options = {}) ⇒ BookingSync::API::Resource
Edit a booking_comment
> :links=>{:booking=>1, :id=>8, :content=>“New content”, :editable=>true, :created_at=>2016-04-18 13:31:40 UTC, :updated_at=>2016-04-18 13:46:06 UTC}
58 59 60 |
# File 'lib/bookingsync/api/client/booking_comments.rb', line 58 def edit_booking_comment(booking_comment, = {}) put("booking_comments/#{booking_comment}", booking_comments: []).pop end |