Class: Kuby::Docker::Dockerfile::From
- Defined in:
- lib/kuby/docker/dockerfile.rb
Instance Attribute Summary collapse
-
#as ⇒ Object
readonly
Returns the value of attribute as.
-
#image_url ⇒ Object
readonly
Returns the value of attribute image_url.
Attributes inherited from Command
Instance Method Summary collapse
-
#initialize(image_url, as: nil) ⇒ From
constructor
A new instance of From.
- #to_s ⇒ Object
Constructor Details
#initialize(image_url, as: nil) ⇒ From
Returns a new instance of From.
35 36 37 38 |
# File 'lib/kuby/docker/dockerfile.rb', line 35 def initialize(image_url, as: nil) @image_url = image_url @as = as end |
Instance Attribute Details
#as ⇒ Object (readonly)
Returns the value of attribute as.
32 33 34 |
# File 'lib/kuby/docker/dockerfile.rb', line 32 def as @as end |
#image_url ⇒ Object (readonly)
Returns the value of attribute image_url.
29 30 31 |
# File 'lib/kuby/docker/dockerfile.rb', line 29 def image_url @image_url end |
Instance Method Details
#to_s ⇒ Object
41 42 43 44 45 |
# File 'lib/kuby/docker/dockerfile.rb', line 41 def to_s str = "FROM #{image_url}" str << " AS #{as}" if as str end |