Method: Docker::Base#initialize

Defined in:
lib/docker/base.rb

#initialize(connection, hash = {}) ⇒ Object

The private new method accepts a connection and a hash of options that must include an id.

Raises:



10
11
12
13
14
15
16
17
# File 'lib/docker/base.rb', line 10

def initialize(connection, hash={})
  unless connection.is_a?(Docker::Connection)
    raise ArgumentError, "Expected a Docker::Connection, got: #{connection}."
  end
  normalize_hash(hash)
  @connection, @info, @id = connection, hash, hash['id']
  raise ArgumentError, "Must have id, got: #{hash}" unless @id
end