Sha256: 0e862dcc9b66a5bb88a6116a7e09fbc4600b0992b9ceacf5ea650775d6a230e8

Contents?: true

Size: 673 Bytes

Versions: 1

Compression:

Stored size: 673 Bytes

Contents

module Rung
  module Definition
    module OperationDSL
      def around_callbacks
        @around_callbacks ||= []
      end

      def around_each_callbacks
        @around_each_callbacks ||= []
      end

      def around(action = nil, &block)
        around_callbacks.push callback_from_definition(action, &block)
      end

      def around_each(action = nil, &block)
        around_each_callbacks.push callback_from_definition(action, &block)
      end

      private

      def callback_from_definition(action, &block)
        if block
          Callback.new block, from_block: true
        else
          Callback.new action
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rung-0.1 lib/rung/definition/operation_dsl.rb