Module: VagrantAutoDNS::Action::Common

Included in:
Add, Delete, RedirectDNS, Start, Teardown
Defined in:
lib/vagrant-autodns/action.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



20
21
22
# File 'lib/vagrant-autodns/action.rb', line 20

def self.included(base)
  base.send(:attr_reader, :app, :env, :log, :machine)
end

Instance Method Details

#call(env) ⇒ Object



32
33
34
35
# File 'lib/vagrant-autodns/action.rb', line 32

def call(env)
  @app.call(env)
  action if @machine.config.autodns.enabled?
end

#hostnameObject



24
25
26
# File 'lib/vagrant-autodns/action.rb', line 24

def hostname
  @machine.config.vm.hostname
end

#initialize(app, env) ⇒ Object



13
14
15
16
17
18
# File 'lib/vagrant-autodns/action.rb', line 13

def initialize(app, env)
  @app = app
  @env = env
  @log =  Log4r::Logger.new('vagrant::autodns') #env[:ui]
  @machine = env[:machine]
end

#machine_nameObject



28
29
30
# File 'lib/vagrant-autodns/action.rb', line 28

def machine_name
  @machine.name.to_s
end