Class: VagrantPlugins::GlobalStatus::Action::RegisterMachine
- Inherits:
-
Object
- Object
- VagrantPlugins::GlobalStatus::Action::RegisterMachine
- Defined in:
- lib/vagrant-global-status/action/register_machine.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env) ⇒ RegisterMachine
constructor
A new instance of RegisterMachine.
Constructor Details
#initialize(app, env) ⇒ RegisterMachine
Returns a new instance of RegisterMachine.
7 8 9 |
# File 'lib/vagrant-global-status/action/register_machine.rb', line 7 def initialize(app, env) @app = app end |
Instance Method Details
#call(env) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/vagrant-global-status/action/register_machine.rb', line 11 def call(env) @app.call(env) if env[:machine].provider.state.id == :running GlobalRegistry.register( home_path: env[:home_path], machine_name: env[:machine].name, root_path: env[:root_path] ) end end |