Module: BookingSync::API::Client::SpecialOffers
- Included in:
- BookingSync::API::Client
- Defined in:
- lib/bookingsync/api/client/special_offers.rb
Instance Method Summary collapse
-
#create_special_offer(rental, options = {}) ⇒ BookingSync::API::Resource
Create a new special offer for a rental.
-
#delete_special_offer(special_offer) ⇒ NilClass
Delete a special offer.
-
#edit_special_offer(special_offer, options = {}) ⇒ BookingSync::API::Resource
Edit a special offer.
-
#special_offer(special_offer, options = {}) ⇒ BookingSync::API::Resource
Get a single special_offer.
-
#special_offers(options = {}, &block) ⇒ Array<BookingSync::API::Resource>
List special_offers.
Instance Method Details
#create_special_offer(rental, options = {}) ⇒ BookingSync::API::Resource
Create a new special offer for a rental
38 39 40 |
# File 'lib/bookingsync/api/client/special_offers.rb', line 38 def create_special_offer(rental, = {}) post("rentals/#{rental}/special_offers", special_offers: []).pop end |
#delete_special_offer(special_offer) ⇒ NilClass
Delete a special offer
61 62 63 |
# File 'lib/bookingsync/api/client/special_offers.rb', line 61 def delete_special_offer(special_offer) delete "special_offers/#{special_offer}" end |
#edit_special_offer(special_offer, options = {}) ⇒ BookingSync::API::Resource
Edit a special offer
52 53 54 |
# File 'lib/bookingsync/api/client/special_offers.rb', line 52 def edit_special_offer(special_offer, = {}) put("special_offers/#{special_offer}", special_offers: []).pop end |
#special_offer(special_offer, options = {}) ⇒ BookingSync::API::Resource
Get a single special_offer
28 29 30 |
# File 'lib/bookingsync/api/client/special_offers.rb', line 28 def special_offer(special_offer, = {}) get("special_offers/#{special_offer}", ).pop end |
#special_offers(options = {}, &block) ⇒ Array<BookingSync::API::Resource>
List special_offers
Returns special offers for the account user is authenticated with.
17 18 19 |
# File 'lib/bookingsync/api/client/special_offers.rb', line 17 def special_offers( = {}, &block) paginate :special_offers, , &block end |