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.
19 20 21 22 |
# File 'lib/kuby/docker/dockerfile.rb', line 19 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.
17 18 19 |
# File 'lib/kuby/docker/dockerfile.rb', line 17 def as @as end |
#image_url ⇒ Object (readonly)
Returns the value of attribute image_url.
17 18 19 |
# File 'lib/kuby/docker/dockerfile.rb', line 17 def image_url @image_url end |
Instance Method Details
#to_s ⇒ Object
24 25 26 27 28 |
# File 'lib/kuby/docker/dockerfile.rb', line 24 def to_s str = "FROM #{image_url}" str << " AS #{as}" if as str end |