Module: DesignManagement::OnSuccessCallbacks

Included in:
DeleteDesignsService, SaveDesignsService
Defined in:
app/services/design_management/on_success_callbacks.rb

Instance Method Summary collapse

Instance Method Details

#on_success(&block) ⇒ Object


5
6
7
# File 'app/services/design_management/on_success_callbacks.rb', line 5

def on_success(&block)
  success_callbacks.push(block)
end

#success(*_) ⇒ Object


9
10
11
12
13
14
15
# File 'app/services/design_management/on_success_callbacks.rb', line 9

def success(*_)
  while cb = success_callbacks.pop
    cb.call
  end

  super
end