Class: Dort::Container
- Inherits:
-
Object
- Object
- Dort::Container
- Defined in:
- lib/dort.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#expose ⇒ Object
readonly
Returns the value of attribute expose.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#ports ⇒ Object
readonly
Returns the value of attribute ports.
Instance Method Summary collapse
-
#initialize(data) ⇒ Container
constructor
A new instance of Container.
- #to_s ⇒ Object (also: #inspect)
Constructor Details
#initialize(data) ⇒ Container
Returns a new instance of Container.
43 44 45 46 47 48 49 |
# File 'lib/dort.rb', line 43 def initialize(data) @data = data @id = @data['Id'][0..11] @name = @data['Name'] @ports = Ports.new @data['HostConfig']['PortBindings'] || [] @expose = Expose.new @data['Config']['ExposedPorts'] || [] end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
41 42 43 |
# File 'lib/dort.rb', line 41 def data @data end |
#expose ⇒ Object (readonly)
Returns the value of attribute expose.
41 42 43 |
# File 'lib/dort.rb', line 41 def expose @expose end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
41 42 43 |
# File 'lib/dort.rb', line 41 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
41 42 43 |
# File 'lib/dort.rb', line 41 def name @name end |
#ports ⇒ Object (readonly)
Returns the value of attribute ports.
41 42 43 |
# File 'lib/dort.rb', line 41 def ports @ports end |
Instance Method Details
#to_s ⇒ Object Also known as: inspect
51 52 53 |
# File 'lib/dort.rb', line 51 def to_s "#<#{self.class}:#{object_id} Id=#{id} Name=#{name}>" end |