Class: Algo::Docker::Base
- Inherits:
-
Object
- Object
- Algo::Docker::Base
- Includes:
- Error
- Defined in:
- lib/algo/docker/base.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#info ⇒ Object
readonly
Returns the value of attribute info.
Instance Method Summary collapse
-
#initialize(connection, hash = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(connection, hash = {}) ⇒ Base
Returns a new instance of Base.
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
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/algo/docker/base.rb', line 6 def id @id end |
#info ⇒ Object (readonly)
Returns the value of attribute info.
6 7 8 |
# File 'lib/algo/docker/base.rb', line 6 def info @info end |