Class: PupilfirstXapi::Outbox

Inherits:
Object
  • Object
show all
Defined in:
lib/pupilfirst_xapi/outbox.rb

Defined Under Namespace

Classes: Job

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lrs:, repository:, uri_for:) ⇒ Outbox

Returns a new instance of Outbox.



29
30
31
32
33
# File 'lib/pupilfirst_xapi/outbox.rb', line 29

def initialize(lrs:, repository:, uri_for:)
  @lrs = lrs
  @repository = repository
  @uri_for = uri_for
end

Class Method Details

.<<(payload) ⇒ Object



24
25
26
# File 'lib/pupilfirst_xapi/outbox.rb', line 24

def <<(payload)
  Outbox::Job.perform_later(payload)
end

Instance Method Details

#call(**payload) ⇒ Object



35
36
37
# File 'lib/pupilfirst_xapi/outbox.rb', line 35

def call(**payload)
  @lrs.call(statement_for(**payload))
end