debian-mirror-gitlab/app/services/design_management/on_success_callbacks.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
351 B
Ruby
Raw Permalink Normal View History

2020-05-24 23:13:21 +05:30
# frozen_string_literal: true
module DesignManagement
module OnSuccessCallbacks
def on_success(&block)
success_callbacks.push(block)
end
def success(*_)
while cb = success_callbacks.pop
cb.call
end
super
end
private
def success_callbacks
@success_callbacks ||= []
end
end
end