Class: VagrantPlugins::Google::Action::WarnNetworks

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-google/action/warn_networks.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ WarnNetworks

Returns a new instance of WarnNetworks.



18
19
20
# File 'lib/vagrant-google/action/warn_networks.rb', line 18

def initialize(app, env)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



22
23
24
25
26
27
28
29
# File 'lib/vagrant-google/action/warn_networks.rb', line 22

def call(env)
  # Default SSH forward always exists so "> 1"
  if env[:machine].config.vm.networks.length > 1
    env[:ui].warn(I18n.t("vagrant_google.warn_networks"))
  end

  @app.call(env)
end