Method: Muster::Rack#initialize

Defined in:
lib/muster/rack.rb

#initialize(app, strategy, options = {}) ⇒ Rack

Creates a new Rack::Muster middleware instance

Examples:


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)

Parameters:

  • app (String)

    Rack application

  • strategy (Muster::Strategies::Rack)

    Muster query string parsing strategy to run

  • options (Hash) (defaults to: {})

    options to pass to the specified strategy



48
49
50
51
52
# File 'lib/muster/rack.rb', line 48

def initialize(app, strategy, options = {})
  @app = app
  @strategy = strategy
  @options = options
end