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