Sha256: acedfce677101165a217b2f33ff60447b5fbba393e1e91bc9bd55574aa021e10

Contents?: true

Size: 500 Bytes

Versions: 17

Compression:

Stored size: 500 Bytes

Contents

require "scorpion/rack"

module Shamu
  module Rack

    # Expose a {QueryParams} hash to any service that wants to toggle behavior
    # based on query parameters.
    class QueryParamsMiddleware
      include Scorpion::Rack

      def initialize( app )
        @app = app
      end

      def call( env )
        query_params = Shamu::Rack::QueryParams.new( env )
        scorpion( env ).hunt_for Shamu::Rack::QueryParams, return: query_params

        @app.call( env )
      end

    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
shamu-0.0.24 lib/shamu/rack/query_params_middleware.rb
shamu-0.0.21 lib/shamu/rack/query_params_middleware.rb
shamu-0.0.20 lib/shamu/rack/query_params_middleware.rb
shamu-0.0.19 lib/shamu/rack/query_params_middleware.rb
shamu-0.0.18 lib/shamu/rack/query_params_middleware.rb
shamu-0.0.17 lib/shamu/rack/query_params_middleware.rb
shamu-0.0.15 lib/shamu/rack/query_params_middleware.rb
shamu-0.0.14 lib/shamu/rack/query_params_middleware.rb
shamu-0.0.13 lib/shamu/rack/query_params_middleware.rb
shamu-0.0.11 lib/shamu/rack/query_params_middleware.rb
shamu-0.0.9 lib/shamu/rack/query_params_middleware.rb
shamu-0.0.8 lib/shamu/rack/query_params_middleware.rb
shamu-0.0.7 lib/shamu/rack/query_params_middleware.rb
shamu-0.0.5 lib/shamu/rack/query_params_middleware.rb
shamu-0.0.4 lib/shamu/rack/query_params_middleware.rb
shamu-0.0.3 lib/shamu/rack/query_params_middleware.rb
shamu-0.0.2 lib/shamu/rack/query_params_middleware.rb