lib/muster/rack.rb
def call(env) # rubocop:disable Metrics/AbcSize
      request  = ::Rack::Request.new(env)
      parser   = strategy.is_a?(Class) ? strategy.new(options) : strategy

      env[QUERY] ||= Muster::Results.new({})
      env[QUERY].merge! parser.parse(request.query_string)
      env[QUERY_STRING] = request.query_string

      @app.call(env)
    end
def call(env) # rubocop:disable Metrics/AbcSize
      request  = ::Rack::Request.new(env)
      parser   = strategy.is_a?(Class) ? strategy.new(options) : strategy

      env[QUERY] ||= Muster::Results.new({})
      env[QUERY].merge! parser.parse(request.query_string)
      env[QUERY_STRING] = request.query_string

      @app.call(env)
    end
def call ( env ) # rubocop:disable Metrics/AbcSize request = :: Rack :: Request . new ( env ) parser = strategy . is_a? ( Class ) ? strategy . new ( options ) : strategy env [ QUERY ] ||= Muster :: Results . new ( { } ) env [ QUERY ] . merge! parser . parse ( request . query_string ) env [ QUERY_STRING ] = request . query_string @app . call ( env ) end
Creates a new Rack::Muster middleware instance

 @param app [String] Rack application
 @param strategy [Muster::Strategies::Rack] Muster query string parsing strategy to run
 @param options [Hash] options to pass to the specified strategy

 @example

   middleware = Muster::Rack.new(app, Muster::Strategies::Hash, :fields => [:name, :choices])

   strategy = Muster::Strategies::Hash.new(:fields => [:name, :choices])
   middleware = Muster::Rack.new(app, strategy)
 Handle Rack request

 @param env [Hash] Rack environment

 @return [Array]
Creates a new Rack :: Muster middleware instance