Class: Docker::Container::Compose
- Inherits:
-
Object
- Object
- Docker::Container::Compose
- Defined in:
- lib/docker/rails/ext/container.rb
Instance Attribute Summary collapse
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#oneoff ⇒ Object
readonly
Returns the value of attribute oneoff.
-
#project ⇒ Object
readonly
Returns the value of attribute project.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(container) ⇒ Compose
constructor
A new instance of Compose.
Constructor Details
#initialize(container) ⇒ Compose
Returns a new instance of Compose.
63 64 65 66 67 68 69 70 |
# File 'lib/docker/rails/ext/container.rb', line 63 def initialize(container) labels = container.info['Labels'] @service = labels['com.docker.compose.service'] @project = labels['com.docker.compose.project'] @oneoff = !!labels['com.docker.compose.oneoff'] @number = labels['com.docker.compose.container-number'].to_i @version = labels['com.docker.compose.version'] end |
Instance Attribute Details
#number ⇒ Object (readonly)
Returns the value of attribute number.
61 62 63 |
# File 'lib/docker/rails/ext/container.rb', line 61 def number @number end |
#oneoff ⇒ Object (readonly)
Returns the value of attribute oneoff.
61 62 63 |
# File 'lib/docker/rails/ext/container.rb', line 61 def oneoff @oneoff end |
#project ⇒ Object (readonly)
Returns the value of attribute project.
61 62 63 |
# File 'lib/docker/rails/ext/container.rb', line 61 def project @project end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
61 62 63 |
# File 'lib/docker/rails/ext/container.rb', line 61 def service @service end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
61 62 63 |
# File 'lib/docker/rails/ext/container.rb', line 61 def version @version end |
Class Method Details
.is_compose_container?(container) ⇒ Boolean
73 74 75 76 |
# File 'lib/docker/rails/ext/container.rb', line 73 def is_compose_container?(container) labels = container.info['Labels'] (!labels.nil? && !labels['com.docker.compose.version'].nil?) end |