Class: VagrantPlugins::CommandDns::Action::ShowIP

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-command-dns/action/show_ip.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ ShowIP

Returns a new instance of ShowIP.



6
7
8
9
# File 'lib/vagrant-command-dns/action/show_ip.rb', line 6

def initialize(app, env)
  @app    = app
  @logger = Log4r::Logger.new('vagrant_command_dns::action::show_ip')
end

Instance Method Details

#call(env) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/vagrant-command-dns/action/show_ip.rb', line 11

def call(env)
  if env[:record_map]
    ip = env[:record_map].values[0]
    env[:ui].info("#{ip}")
  end

  @app.call(env)
end