Class: SyncMachine::EnsurePublicationWorker::Hook

Inherits:
Object
  • Object
show all
Defined in:
lib/sync_machine/ensure_publication_worker.rb

Overview

Wrap build, check_publishable, etc blocks.

Instance Method Summary collapse

Constructor Details

#initialize(name, block) ⇒ Hook

Returns a new instance of Hook.



41
42
43
44
# File 'lib/sync_machine/ensure_publication_worker.rb', line 41

def initialize(name, block)
  @name = name
  @block = block
end

Instance Method Details

#call(*args) ⇒ Object



46
47
48
49
50
# File 'lib/sync_machine/ensure_publication_worker.rb', line 46

def call(*args)
  TracerAdapters.tracer_adapter.start_active_span(@name) do
    @block.call(*args)
  end
end