Class: TransactionalOutbox::Event

Inherits:
Object
  • Object
show all
Extended by:
Dry::Configurable, Contextable, Payloadable
Defined in:
lib/transactional_outbox/event.rb,
lib/transactional_outbox/event/builder.rb,
lib/transactional_outbox/event/contextable.rb,
lib/transactional_outbox/event/payloadable.rb

Defined Under Namespace

Modules: Contextable, Payloadable Classes: Builder

Instance Method Summary collapse

Methods included from Contextable

check_context_validation_result!, context, extended

Methods included from Payloadable

extended, prepare_payload

Instance Method Details

#bulk_create!(contexts) ⇒ Object



33
34
35
36
37
38
39
# File 'lib/transactional_outbox/event.rb', line 33

def bulk_create!(contexts)
  validate_contexts!(contexts)

  events = build_events(contexts)

  save(events)
end

#create!(context) ⇒ Object



25
26
27
28
29
30
31
# File 'lib/transactional_outbox/event.rb', line 25

def create!(context)
  validate_context!(context)

  event = build_event(context)

  save([event])
end