Class: Dip::Commands::DNS::IP

Inherits:
Dip::Command show all
Defined in:
lib/dip/commands/dns.rb

Instance Method Summary collapse

Methods inherited from Dip::Command

shell, subshell

Constructor Details

#initialize(name:, net:) ⇒ IP

Returns a new instance of IP.



49
50
51
52
# File 'lib/dip/commands/dns.rb', line 49

def initialize(name:, net:)
  @name = name
  @net = net
end

Instance Method Details

#execute(**options) ⇒ Object



54
55
56
57
58
59
60
# File 'lib/dip/commands/dns.rb', line 54

def execute(**options)
  subshell("docker",
           "inspect " \
           "--format '{{ .NetworkSettings.Networks.#{@net}.IPAddress }}' " \
           "#{@name}".shellsplit,
           **options)
end