Class: Fountain::Api::AvailableSlots
- Inherits:
-
Object
- Object
- Fountain::Api::AvailableSlots
- Extended by:
- RequestHelper
- Defined in:
- lib/fountain/api/available_slots.rb
Overview
Fountain Slot Management API
Constant Summary
Constants included from RequestHelper
RequestHelper::DEFAULT_REQUEST_OPTIONS
Class Method Summary collapse
-
.cancel(booked_slot_id) ⇒ Fountain::Slot
Cancel a booked session.
-
.confirm(available_slot_id, applicant_id) ⇒ Fountain::Slot
Confirm an available slot.
-
.list(stage_id, list_options = {}) ⇒ [Fountain::Slots]
List Available Slots.
Methods included from RequestHelper
Class Method Details
.cancel(booked_slot_id) ⇒ Fountain::Slot
Cancel a booked session
42 43 44 45 46 47 48 49 |
# File 'lib/fountain/api/available_slots.rb', line 42 def self.cancel(booked_slot_id) response = request( "/v2/booked_slots/#{booked_slot_id}/cancel", method: :post ) check_response response true end |
.confirm(available_slot_id, applicant_id) ⇒ Fountain::Slot
Confirm an available slot
16 17 18 19 20 21 22 23 |
# File 'lib/fountain/api/available_slots.rb', line 16 def self.confirm(available_slot_id, applicant_id) response = request_json( "/v2/available_slots/#{available_slot_id}/confirm", method: :post, body: { applicant_id: applicant_id } ) Fountain::Slot.new response end |
.list(stage_id, list_options = {}) ⇒ [Fountain::Slots]
List Available Slots
29 30 31 32 33 34 35 |
# File 'lib/fountain/api/available_slots.rb', line 29 def self.list(stage_id, = {}) page_query = [:page] ? "?page=#{[:page]}" : '' response = request_json( "/v2/stages/#{stage_id}/available_slots#{page_query}" ) Fountain::Slots.new response end |