Class: Rexec::Container
- Inherits:
-
Object
- Object
- Rexec::Container
- Defined in:
- lib/rexec/container.rb
Overview
Represents a Rexec container/sandbox.
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#image ⇒ Object
readonly
Returns the value of attribute image.
-
#labels ⇒ Object
readonly
Returns the value of attribute labels.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#started_at ⇒ Object
readonly
Returns the value of attribute started_at.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(data) ⇒ Container
constructor
A new instance of Container.
- #running? ⇒ Boolean
- #stopped? ⇒ Boolean
Constructor Details
#initialize(data) ⇒ Container
Returns a new instance of Container.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/rexec/container.rb', line 8 def initialize(data) @id = data["id"] @name = data["name"] @image = data["image"] @status = data["status"] @created_at = data["created_at"] @started_at = data["started_at"] @labels = data["labels"] || {} @environment = data["environment"] || {} end |
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
6 7 8 |
# File 'lib/rexec/container.rb', line 6 def created_at @created_at end |
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
6 7 8 |
# File 'lib/rexec/container.rb', line 6 def environment @environment end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/rexec/container.rb', line 6 def id @id end |
#image ⇒ Object (readonly)
Returns the value of attribute image.
6 7 8 |
# File 'lib/rexec/container.rb', line 6 def image @image end |
#labels ⇒ Object (readonly)
Returns the value of attribute labels.
6 7 8 |
# File 'lib/rexec/container.rb', line 6 def labels @labels end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/rexec/container.rb', line 6 def name @name end |
#started_at ⇒ Object (readonly)
Returns the value of attribute started_at.
6 7 8 |
# File 'lib/rexec/container.rb', line 6 def started_at @started_at end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
6 7 8 |
# File 'lib/rexec/container.rb', line 6 def status @status end |
Instance Method Details
#running? ⇒ Boolean
19 20 21 |
# File 'lib/rexec/container.rb', line 19 def running? status == "running" end |
#stopped? ⇒ Boolean
23 24 25 |
# File 'lib/rexec/container.rb', line 23 def stopped? status == "stopped" end |