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