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.
55 56 57 58 59 60 61 62 |
# File 'lib/docker/rails/ext/container.rb', line 55 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.
53 54 55 |
# File 'lib/docker/rails/ext/container.rb', line 53 def number @number end |
#oneoff ⇒ Object (readonly)
Returns the value of attribute oneoff.
53 54 55 |
# File 'lib/docker/rails/ext/container.rb', line 53 def oneoff @oneoff end |
#project ⇒ Object (readonly)
Returns the value of attribute project.
53 54 55 |
# File 'lib/docker/rails/ext/container.rb', line 53 def project @project end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
53 54 55 |
# File 'lib/docker/rails/ext/container.rb', line 53 def service @service end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
53 54 55 |
# File 'lib/docker/rails/ext/container.rb', line 53 def version @version end |
Class Method Details
.is_compose_container?(container) ⇒ Boolean
65 66 67 68 |
# File 'lib/docker/rails/ext/container.rb', line 65 def is_compose_container?(container) labels = container.info['Labels'] (!labels.nil? && !labels['com.docker.compose.version'].nil?) end |