Class: Dip::Commands::DNS::IP
- Inherits:
-
Dip::Command
- Object
- Dip::Command
- Dip::Commands::DNS::IP
- Defined in:
- lib/dip/commands/dns.rb
Instance Method Summary collapse
- #execute(**options) ⇒ Object
-
#initialize(name:, net:) ⇒ IP
constructor
A new instance of IP.
Methods inherited from Dip::Command
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(**) exec_subprocess( "docker", "inspect --format '{{ .NetworkSettings.Networks.#{@net}.IPAddress }}' #{@name}", ** ) end |