Class: Gitlab::Ci::Build::Image
- Inherits:
-
Object
- Object
- Gitlab::Ci::Build::Image
- Defined in:
- lib/gitlab/ci/build/image.rb
Instance Attribute Summary collapse
-
#alias ⇒ Object
readonly
Returns the value of attribute alias.
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#entrypoint ⇒ Object
readonly
Returns the value of attribute entrypoint.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#ports ⇒ Object
readonly
Returns the value of attribute ports.
-
#pull_policy ⇒ Object
readonly
Returns the value of attribute pull_policy.
-
#variables ⇒ Object
readonly
Returns the value of attribute variables.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(image) ⇒ Image
constructor
A new instance of Image.
- #valid? ⇒ Boolean
Constructor Details
#initialize(image) ⇒ Image
Returns a new instance of Image.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/gitlab/ci/build/image.rb', line 26 def initialize(image) case image when String @name = image @ports = [] when Hash @alias = image[:alias] @command = image[:command] @entrypoint = image[:entrypoint] @name = image[:name] @ports = build_ports(image).select(&:valid?) @variables = build_variables(image) @pull_policy = image[:pull_policy] end end |
Instance Attribute Details
#alias ⇒ Object (readonly)
Returns the value of attribute alias.
7 8 9 |
# File 'lib/gitlab/ci/build/image.rb', line 7 def alias @alias end |
#command ⇒ Object (readonly)
Returns the value of attribute command.
7 8 9 |
# File 'lib/gitlab/ci/build/image.rb', line 7 def command @command end |
#entrypoint ⇒ Object (readonly)
Returns the value of attribute entrypoint.
7 8 9 |
# File 'lib/gitlab/ci/build/image.rb', line 7 def entrypoint @entrypoint end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/gitlab/ci/build/image.rb', line 7 def name @name end |
#ports ⇒ Object (readonly)
Returns the value of attribute ports.
7 8 9 |
# File 'lib/gitlab/ci/build/image.rb', line 7 def ports @ports end |
#pull_policy ⇒ Object (readonly)
Returns the value of attribute pull_policy.
7 8 9 |
# File 'lib/gitlab/ci/build/image.rb', line 7 def pull_policy @pull_policy end |
#variables ⇒ Object (readonly)
Returns the value of attribute variables.
7 8 9 |
# File 'lib/gitlab/ci/build/image.rb', line 7 def variables @variables end |
Class Method Details
Instance Method Details
#valid? ⇒ Boolean
42 43 44 |
# File 'lib/gitlab/ci/build/image.rb', line 42 def valid? @name.present? end |