class Algo::Docker::Base

Attributes

connection[RW]
id[R]
info[R]

Public Class Methods

new(connection, hash={}) click to toggle source
# 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

Private Instance Methods

normalize_hash(hash) click to toggle source
# File lib/algo/docker/base.rb, line 20
def normalize_hash(hash)
  hash["Id"] ||= hash.delete("ID")
end