Module: DCI::Context::InstanceMethods
- Defined in:
- lib/dci/context.rb
Instance Method Summary collapse
Instance Method Details
#call ⇒ Object
39 40 41 |
# File 'lib/dci/context.rb', line 39 def call raise NotImplementedError.new("implement me") end |
#context=(ctx) ⇒ Object
35 36 37 |
# File 'lib/dci/context.rb', line 35 def context=(ctx) Thread.current[:context] = ctx end |
#perform_in_transaction ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/dci/context.rb', line 17 def perform_in_transaction old_context = context @events = init_context_events self.context = self res = nil DCI.configuration.transaction_class.transaction do res = call end route_events!(events) res ensure self.context = old_context self.events.clear end |