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.



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

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

Instance Attribute Details

#hostObject

Returns the value of attribute host.



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

def host
  @host
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

Instance Method Details

#ip_addressObject



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

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

#statusObject



253
254
255
256
# File 'lib/conjure/service/docker_host.rb', line 253

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