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