Sha256: 2714b117e4778c055a162f5cb46616c44ea1077c0062bfbfe3c3319ffd6ef2d4
Contents?: true
Size: 558 Bytes
Versions: 8
Compression:
Stored size: 558 Bytes
Contents
# frozen_string_literal: true module ConvenientService module Common module Plugins module HasCallbacks class Middleware < Core::MethodChainMiddleware def next(...) entity.callbacks.for([:before, method]).each { |callback| callback.call_in_context(entity) } original_value = chain.next(...) entity.callbacks.for([:after, method]).reverse_each { |callback| callback.call_in_context(entity, original_value) } original_value end end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems