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.
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 |
# File 'lib/gitlab/ci/build/image.rb', line 26 def initialize(image) if image.is_a?(String) @name = image @ports = [] elsif image.is_a?(Hash) @alias = image[:alias] @command = image[:command] @entrypoint = image[:entrypoint] @name = image[:name] @ports = build_ports(image).select(&:valid?) 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 |
Class Method Details
Instance Method Details
#valid? ⇒ Boolean
39 40 41 |
# File 'lib/gitlab/ci/build/image.rb', line 39 def valid? @name.present? end |