Sha256: 86864618402a6a7cac2cfc78ff9e107b6e86e51ea8abfcd1bf3094282e9ae71e
Contents?: true
Size: 887 Bytes
Versions: 20
Compression:
Stored size: 887 Bytes
Contents
# frozen_string_literal: true module ConvenientService module Common module Plugins module HasCallbacks module Concern include Support::Concern instance_methods do include Support::Delegate delegate :callbacks, to: :class end class_methods do ## # @api private # def callbacks @__callbacks__ ||= Entities::CallbackCollection.new end def before(type, &block) Entities::Callback.new(types: [:before, type], block: block).tap { |callback| callbacks << callback } end def after(type, &block) Entities::Callback.new(types: [:after, type], block: block).tap { |callback| callbacks << callback } end end end end end end end
Version data entries
20 entries across 20 versions & 1 rubygems