Class: Algo::Docker::Base

Inherits:
Object
  • Object
show all
Includes:
Error
Defined in:
lib/algo/docker/base.rb

Direct Known Subclasses

Network, Service

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Base.

Raises:



8
9
10
11
12
13
14
15
# File 'lib/algo/docker/base.rb', line 8

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/algo/docker/base.rb', line 6

def id
  @id
end

#infoObject (readonly)

Returns the value of attribute info.



6
7
8
# File 'lib/algo/docker/base.rb', line 6

def info
  @info
end