Class: OSC::Reservations::Adapter
- Inherits:
-
Object
- Object
- OSC::Reservations::Adapter
- Defined in:
- lib/osc/reservations/adapter.rb
Overview
Adapters are the glue between Reservations API and the scheduling service. This provides a scheduler independent interface.
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Adapter
constructor
A new instance of Adapter.
-
#query_reservation(batch, id) ⇒ Reservation?
abstract
Queries the batch server for a given reservation.
-
#query_reservations(batch) ⇒ Array<Reservation>
abstract
Queries the batch server for a list of reservations.
-
#submit_reservation(batch, reservation) ⇒ Reservation
abstract
Submits a given reservation to the batch server.
Constructor Details
#initialize(opts = {}) ⇒ Adapter
Returns a new instance of Adapter.
7 8 |
# File 'lib/osc/reservations/adapter.rb', line 7 def initialize(opts = {}) end |
Instance Method Details
#query_reservation(batch, id) ⇒ Reservation?
This method is abstract.
This should be implemented by the adapter.
Queries the batch server for a given reservation.
15 16 17 |
# File 'lib/osc/reservations/adapter.rb', line 15 def query_reservation(batch, id) raise NotImplementedError end |
#query_reservations(batch) ⇒ Array<Reservation>
This method is abstract.
This should be implemented by the adapter.
Queries the batch server for a list of reservations.
23 24 25 |
# File 'lib/osc/reservations/adapter.rb', line 23 def query_reservations(batch) raise NotImplementedError end |
#submit_reservation(batch, reservation) ⇒ Reservation
This method is abstract.
This should be implemented by the adapter.
Submits a given reservation to the batch server.
33 34 35 |
# File 'lib/osc/reservations/adapter.rb', line 33 def submit_reservation(batch, reservation) raise NotImplementedError end |