Sha256: baffafabb054dba7be22cf9ce8ec25df03f261cc6408198fd44607c2d033ce9d

Contents?: true

Size: 547 Bytes

Versions: 16

Compression:

Stored size: 547 Bytes

Contents

require 'vx/common/rack/builder'

module Vx
  module Common
    module Helper
      module Middlewares

        def self.included(base)
          base.send :extend, ClassMethods
        end

        def run_middlewares(*args, &block)
          self.class.builder.to_app(block).call(*args)
        end
        private :run_middlewares

        module ClassMethods

          attr_reader :builder

          def middlewares(&block)
            @builder = Vx::Common::Rack::Builder.new(&block)
          end

        end

      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
vx-common-0.4.0 lib/vx/common/helper/middlewares.rb
vx-common-0.3.2 lib/vx/common/helper/middlewares.rb
vx-common-0.3.1 lib/vx/common/helper/middlewares.rb
vx-common-0.3.0 lib/vx/common/helper/middlewares.rb
vx-common-0.2.1 lib/vx/common/helper/middlewares.rb
vx-common-0.2.0.pre38 lib/vx/common/helper/middlewares.rb
vx-common-0.2.0.pre37 lib/vx/common/helper/middlewares.rb
vx-common-0.2.0.pre36 lib/vx/common/helper/middlewares.rb
vx-common-0.2.0.pre35 lib/vx/common/helper/middlewares.rb
vx-common-0.2.0.pre34 lib/vx/common/helper/middlewares.rb
vx-common-0.2.0.pre33 lib/vx/common/helper/middlewares.rb
vx-common-0.2.0.pre32 lib/vx/common/helper/middlewares.rb
vx-common-0.2.0.pre31 lib/vx/common/helper/middlewares.rb
vx-common-0.2.0.pre30 lib/vx/common/helper/middlewares.rb
vx-common-0.2.0.pre29 lib/vx/common/helper/middlewares.rb
vx-common-0.2.0.pre28 lib/vx/common/helper/middlewares.rb