Module: BookingSync::API::Client::RentalUrls
- Included in:
- BookingSync::API::Client
- Defined in:
- lib/bookingsync/api/client/rental_urls.rb
Instance Method Summary collapse
-
#cancel_rental_url(rental_url) ⇒ NilClass
Cancel a RentalUrl.
-
#create_rental_url(rental, options = {}) ⇒ BookingSync::API::Resource
Create a new rental_url.
-
#edit_rental_url(rental_url, options = {}) ⇒ BookingSync::API::Resource
Edit a rental_url.
-
#rental_url(rental_url) ⇒ BookingSync::API::Resource
Get a single rental_url.
-
#rental_urls(options = {}, &block) ⇒ Array<BookingSync::API::Resource>
List rental_urls.
Instance Method Details
#cancel_rental_url(rental_url) ⇒ NilClass
Cancel a RentalUrl
61 62 63 |
# File 'lib/bookingsync/api/client/rental_urls.rb', line 61 def cancel_rental_url(rental_url) delete "rental_urls/#{rental_url}" end |
#create_rental_url(rental, options = {}) ⇒ BookingSync::API::Resource
Create a new rental_url
32 33 34 35 36 37 |
# File 'lib/bookingsync/api/client/rental_urls.rb', line 32 def create_rental_url(rental, = {}) if file_path = .delete(:file_path) [:file] ||= base_64_encode(file_path) end post("rentals/#{rental}/rental_urls", rental_urls: ).pop end |
#edit_rental_url(rental_url, options = {}) ⇒ BookingSync::API::Resource
Edit a rental_url
49 50 51 52 53 54 |
# File 'lib/bookingsync/api/client/rental_urls.rb', line 49 def edit_rental_url(rental_url, = {}) if file_path = .delete(:file_path) [:file] ||= base_64_encode(file_path) end put("rental_urls/#{rental_url}", rental_urls: ).pop end |
#rental_url(rental_url) ⇒ BookingSync::API::Resource
Get a single rental_url
24 25 26 |
# File 'lib/bookingsync/api/client/rental_urls.rb', line 24 def rental_url(rental_url) get("rental_urls/#{rental_url}").pop end |
#rental_urls(options = {}, &block) ⇒ Array<BookingSync::API::Resource>
List rental_urls
Returns rental_urls for the account user is authenticated with.
15 16 17 |
# File 'lib/bookingsync/api/client/rental_urls.rb', line 15 def rental_urls( = {}, &block) paginate :rental_urls, , &block end |