class VagrantPlugins::ManagedServers::Action::IsLinked

This can be used with “Call” built-in to check if the machine is linked and branch in the middleware.

Public Class Methods

new(app, env) click to toggle source
# File lib/vagrant-managed-servers/action/is_linked.rb, line 7
def initialize(app, env)
  @app = app
end

Public Instance Methods

call(env) click to toggle source
# File lib/vagrant-managed-servers/action/is_linked.rb, line 11
def call(env)
  env[:result] = env[:machine].state.id != :not_linked
  @app.call(env)
end