Class: Viaduct::Env::Set

Inherits:
Object
  • Object
show all
Defined in:
lib/viaduct/env.rb

Overview

A middleware which just sets up the environment with some options which are passed to it.

Instance Method Summary collapse

Constructor Details

#initialize(app, env, options = nil) ⇒ Set

Returns a new instance of Set.



6
7
8
9
# File 'lib/viaduct/env.rb', line 6

def initialize(app, env, options=nil)
  @app     = app
  @options = options || {}
end

Instance Method Details

#call(env) ⇒ Object



11
12
13
14
15
16
# File 'lib/viaduct/env.rb', line 11

def call(env)
  # Merge the options that were given to us
  env.merge!(@options)

  @app.call(env)
end