Class: Conjure::Service::Container

Inherits:
Object
  • Object
show all
Defined in:
lib/conjure/service/docker_host.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Container

Returns a new instance of Container.



238
239
240
241
# File 'lib/conjure/service/docker_host.rb', line 238

def initialize(options)
  self.id = options[:id]
  self.host = options[:host]
end

Instance Attribute Details

#hostObject

Returns the value of attribute host.



236
237
238
# File 'lib/conjure/service/docker_host.rb', line 236

def host
  @host
end

#idObject

Returns the value of attribute id.



236
237
238
# File 'lib/conjure/service/docker_host.rb', line 236

def id
  @id
end

Instance Method Details

#ip_addressObject



243
244
245
# File 'lib/conjure/service/docker_host.rb', line 243

def ip_address
  status["NetworkSettings"]["IPAddress"]
end

#statusObject



247
248
249
250
# File 'lib/conjure/service/docker_host.rb', line 247

def status
  require "json"
  JSON.parse(host.command "inspect #{id}").first
end