Method: Inspec::Resources::Docker#object

Defined in:
lib/resources/docker.rb

#object(id) ⇒ Object

returns information about docker objects



154
155
156
157
158
159
160
161
# File 'lib/resources/docker.rb', line 154

def object(id)
  return @inspect if defined?(@inspect)
  data = JSON.parse(inspec.command("docker inspect #{id}").stdout)
  data = data[0] if data.is_a?(Array)
  @inspect = Hashie::Mash.new(data)
rescue JSON::ParserError => _e
  return Hashie::Mash.new({})
end