Class: VagrantBindfs::Vagrant::Actions::Mounter

Inherits:
Object
  • Object
show all
Includes:
Concerns::Log, Concerns::Machine
Defined in:
lib/vagrant-bindfs/vagrant/actions/mounter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Concerns::Log

#debug, #detail, #error, #info, #logger, #warn

Methods included from Concerns::Machine

#binded_folders, #config, #guest, #machine

Constructor Details

#initialize(app, env, hook) ⇒ Mounter

Returns a new instance of Mounter.



14
15
16
17
18
# File 'lib/vagrant-bindfs/vagrant/actions/mounter.rb', line 14

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

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.



7
8
9
# File 'lib/vagrant-bindfs/vagrant/actions/mounter.rb', line 7

def app
  @app
end

#envObject (readonly)

Returns the value of attribute env.



8
9
10
# File 'lib/vagrant-bindfs/vagrant/actions/mounter.rb', line 8

def env
  @env
end

#hookObject (readonly)

Returns the value of attribute hook.



9
10
11
# File 'lib/vagrant-bindfs/vagrant/actions/mounter.rb', line 9

def hook
  @hook
end

Instance Method Details

#call(env) ⇒ Object



20
21
22
23
24
# File 'lib/vagrant-bindfs/vagrant/actions/mounter.rb', line 20

def call(env)
  app.call(env)
  return if binded_folders(hook).empty?
  bind_folders!
end