Class: Kuby::Docker::Dockerfile::Copy
- Defined in:
- lib/kuby/docker/dockerfile.rb
Instance Attribute Summary collapse
-
#dest ⇒ Object
readonly
T::Sig::WithoutRuntime.sig { returns(String) }.
-
#from ⇒ Object
readonly
T::Sig::WithoutRuntime.sig { returns(T.nilable(String)) }.
-
#source ⇒ Object
readonly
T::Sig::WithoutRuntime.sig { returns(String) }.
Attributes inherited from Command
Instance Method Summary collapse
-
#initialize(source, dest, from: nil) ⇒ Copy
constructor
T::Sig::WithoutRuntime.sig { params(source: String, dest: String, from: T.nilable(String)).void }.
-
#to_s ⇒ Object
T::Sig::WithoutRuntime.sig { returns(String) }.
Constructor Details
#initialize(source, dest, from: nil) ⇒ Copy
T::Sig::WithoutRuntime.sig { params(source: String, dest: String, from: T.nilable(String)).void }
74 75 76 77 78 |
# File 'lib/kuby/docker/dockerfile.rb', line 74 def initialize(source, dest, from: nil) @source = source @dest = dest @from = from end |
Instance Attribute Details
#dest ⇒ Object (readonly)
T::Sig::WithoutRuntime.sig { returns(String) }
68 69 70 |
# File 'lib/kuby/docker/dockerfile.rb', line 68 def dest @dest end |
#from ⇒ Object (readonly)
T::Sig::WithoutRuntime.sig { returns(T.nilable(String)) }
71 72 73 |
# File 'lib/kuby/docker/dockerfile.rb', line 71 def from @from end |
#source ⇒ Object (readonly)
T::Sig::WithoutRuntime.sig { returns(String) }
65 66 67 |
# File 'lib/kuby/docker/dockerfile.rb', line 65 def source @source end |
Instance Method Details
#to_s ⇒ Object
T::Sig::WithoutRuntime.sig { returns(String) }
81 82 83 84 85 86 |
# File 'lib/kuby/docker/dockerfile.rb', line 81 def to_s cmd = ['COPY'] cmd << "--from=#{from}" if from cmd += [source, dest] cmd.join(' ') end |