Sha256: b392ec35bc9dad34aa0a73264dc14d355f85836debf9f5d022ab927bc514d8f2

Contents?: true

Size: 961 Bytes

Versions: 2

Compression:

Stored size: 961 Bytes

Contents

module Flows
  class SharedContextPipeline
    module DSL
      # @api private
      module Callbacks
        SingletonVarsSetup = Flows::Util::InheritableSingletonVars::DupStrategy.make_module(
          '@before_all_callbacks' => [],
          '@after_all_callbacks' => [],
          '@before_each_callbacks' => [],
          '@after_each_callbacks' => []
        )

        include SingletonVarsSetup

        attr_reader :before_all_callbacks
        attr_reader :after_all_callbacks
        attr_reader :before_each_callbacks
        attr_reader :after_each_callbacks

        def before_all(&callback)
          before_all_callbacks << callback
        end

        def after_all(&callback)
          after_all_callbacks << callback
        end

        def before_each(&callback)
          before_each_callbacks << callback
        end

        def after_each(&callback)
          after_each_callbacks << callback
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
flows-0.5.1 lib/flows/shared_context_pipeline/dsl/callbacks.rb
flows-0.5.0 lib/flows/shared_context_pipeline/dsl/callbacks.rb