Class: Vagrant::Action::Env::Set

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant/action/env/set.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.



7
8
9
10
# File 'lib/vagrant/action/env/set.rb', line 7

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

Instance Method Details

#call(env) ⇒ Object



12
13
14
15
16
17
# File 'lib/vagrant/action/env/set.rb', line 12

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

  @app.call(env)
end