Sha256: 949268b9268033b1716ff561ca7d9415e8bf956091acfb407f5c57e6c045a3d6

Contents?: true

Size: 777 Bytes

Versions: 1

Compression:

Stored size: 777 Bytes

Contents

# frozen_string_literal: true

module LightServiceExt
  class ApplicationAction
    extend LightService::Action


    def self.inherited(base)
      base.extend LifecycleMethods
      base.singleton_class.prepend AroundActionExecuteExtension
      super
    end

    module LifecycleMethods
      attr_writer :before_execute_block, :after_execute_block, :after_success_block, :after_failure_block

      def before_execute_block
        @before_execute_block ||= ->(_context) {}
      end

      def after_execute_block
        @after_execute_block ||= ->(_context) {}
      end

      def after_success_block
        @after_success_block ||= ->(_context) {}
      end

      def after_failure_block
        @after_failure_block ||= ->(_context) {}
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
light-service-ext-0.1.11 lib/light-service-ext/application_action.rb