Class: Kuby::Docker::Dockerfile::From
- Defined in:
- lib/kuby/docker/dockerfile.rb
Instance Attribute Summary collapse
-
#as ⇒ Object
readonly
T::Sig::WithoutRuntime.sig { returns(T.nilable(String)) }.
-
#image_url ⇒ Object
readonly
T::Sig::WithoutRuntime.sig { returns(String) }.
Attributes inherited from Command
Instance Method Summary collapse
-
#initialize(image_url, as: nil) ⇒ From
constructor
T::Sig::WithoutRuntime.sig { params(image_url: String, as: T.nilable(String)).void }.
-
#to_s ⇒ Object
T::Sig::WithoutRuntime.sig { returns(String) }.
Constructor Details
#initialize(image_url, as: nil) ⇒ From
T::Sig::WithoutRuntime.sig { params(image_url: String, as: T.nilable(String)).void }
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)
T::Sig::WithoutRuntime.sig { returns(T.nilable(String)) }
32 33 34 |
# File 'lib/kuby/docker/dockerfile.rb', line 32 def as @as end |
#image_url ⇒ Object (readonly)
T::Sig::WithoutRuntime.sig { returns(String) }
29 30 31 |
# File 'lib/kuby/docker/dockerfile.rb', line 29 def image_url @image_url end |
Instance Method Details
#to_s ⇒ Object
T::Sig::WithoutRuntime.sig { returns(String) }
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 |