Module: BookingSync::API::Client::Bathrooms
- Included in:
- BookingSync::API::Client
- Defined in:
- lib/bookingsync/api/client/bathrooms.rb
Instance Method Summary collapse
-
#bathroom(bathroom, options = {}) ⇒ BookingSync::API::Resource
Get a single bathroom.
-
#bathrooms(options = {}, &block) ⇒ Array<BookingSync::API::Resource>
List bathrooms.
-
#cancel_bathroom(bathroom) ⇒ NilClass
Cancel a bathroom.
-
#create_bathroom(rental, options = {}) ⇒ BookingSync::API::Resource
Create a new bathroom.
-
#edit_bathroom(bathroom, options = {}) ⇒ BookingSync::API::Resource
Edit a bathroom.
Instance Method Details
#bathroom(bathroom, options = {}) ⇒ BookingSync::API::Resource
Get a single bathroom
27 28 29 |
# File 'lib/bookingsync/api/client/bathrooms.rb', line 27 def bathroom(bathroom, = {}) get("bathrooms/#{bathroom}", ).pop end |
#bathrooms(options = {}, &block) ⇒ Array<BookingSync::API::Resource>
List bathrooms
Returns bathrooms for the account user is authenticated with.
16 17 18 |
# File 'lib/bookingsync/api/client/bathrooms.rb', line 16 def bathrooms( = {}, &block) paginate :bathrooms, , &block end |
#cancel_bathroom(bathroom) ⇒ NilClass
Cancel a bathroom
60 61 62 |
# File 'lib/bookingsync/api/client/bathrooms.rb', line 60 def cancel_bathroom(bathroom) delete "bathrooms/#{bathroom}" end |
#create_bathroom(rental, options = {}) ⇒ BookingSync::API::Resource
Create a new bathroom
37 38 39 |
# File 'lib/bookingsync/api/client/bathrooms.rb', line 37 def create_bathroom(rental, = {}) post("rentals/#{rental}/bathrooms", bathrooms: []).pop end |
#edit_bathroom(bathroom, options = {}) ⇒ BookingSync::API::Resource
Edit a bathroom
51 52 53 |
# File 'lib/bookingsync/api/client/bathrooms.rb', line 51 def edit_bathroom(bathroom, = {}) put("bathrooms/#{bathroom}", bathrooms: []).pop end |