Module: BookingSync::API::Client::Bookings
- Included in:
- BookingSync::API::Client
- Defined in:
- lib/bookingsync/api/client/bookings.rb
Instance Method Summary collapse
-
#add_bookings_fee(booking, options = {}) ⇒ BookingSync::API::Resource
Add a bookings_fee.
-
#booking(booking, options = {}) ⇒ BookingSync::API::Resource
Get a single booking.
-
#bookings(options = {}, &block) ⇒ Array<BookingSync::API::Resource>
List bookings.
-
#cancel_booking(booking, options = nil) ⇒ NilClass
Cancel a booking.
-
#create_booking(rental, options = {}) ⇒ BookingSync::API::Resource
Create a booking.
-
#edit_booking(booking, options = {}) ⇒ BookingSync::API::Resource
Edit a booking.
-
#remove_bookings_fee(booking, bookings_fee_id) ⇒ BookingSync::API::Resource
Remove a bookings_fee.
Instance Method Details
#add_bookings_fee(booking, options = {}) ⇒ BookingSync::API::Resource
Add a bookings_fee
for which the bookings fee should be added
95 96 97 |
# File 'lib/bookingsync/api/client/bookings.rb', line 95 def add_bookings_fee(booking, = {}) patch("bookings/#{booking}/add_bookings_fee", bookings_fees: []).pop end |
#booking(booking, options = {}) ⇒ BookingSync::API::Resource
Get a single booking
42 43 44 |
# File 'lib/bookingsync/api/client/bookings.rb', line 42 def booking(booking, = {}) get("bookings/#{booking}", ).pop end |
#bookings(options = {}, &block) ⇒ Array<BookingSync::API::Resource>
List bookings
Return public future bookings for the account user is authenticated with.
29 30 31 |
# File 'lib/bookingsync/api/client/bookings.rb', line 29 def bookings( = {}, &block) paginate :bookings, , &block end |
#cancel_booking(booking, options = nil) ⇒ NilClass
Cancel a booking
81 82 83 84 |
# File 'lib/bookingsync/api/client/bookings.rb', line 81 def cancel_booking(booking, = nil) = { bookings: [] } if delete "bookings/#{booking}", end |
#create_booking(rental, options = {}) ⇒ BookingSync::API::Resource
Create a booking
52 53 54 |
# File 'lib/bookingsync/api/client/bookings.rb', line 52 def create_booking(rental, = {}) post("rentals/#{rental}/bookings", bookings: []).pop end |
#edit_booking(booking, options = {}) ⇒ BookingSync::API::Resource
Edit a booking
65 66 67 |
# File 'lib/bookingsync/api/client/bookings.rb', line 65 def edit_booking(booking, = {}) put("bookings/#{booking}", bookings: []).pop end |
#remove_bookings_fee(booking, bookings_fee_id) ⇒ BookingSync::API::Resource
Remove a bookings_fee
for which the bookings fee should be removed
108 109 110 |
# File 'lib/bookingsync/api/client/bookings.rb', line 108 def remove_bookings_fee(booking, bookings_fee_id) patch("bookings/#{booking}/remove_bookings_fee/#{bookings_fee_id}").pop end |