Class: Kuby::Docker::Dockerfile::Copy
- Defined in:
- lib/kuby/docker/dockerfile.rb
Instance Attribute Summary collapse
-
#dest ⇒ Object
readonly
Returns the value of attribute dest.
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Attributes inherited from Command
Instance Method Summary collapse
-
#initialize(source, dest, from: nil) ⇒ Copy
constructor
A new instance of Copy.
- #to_s ⇒ Object
Constructor Details
#initialize(source, dest, from: nil) ⇒ Copy
Returns a new instance of Copy.
46 47 48 49 50 |
# File 'lib/kuby/docker/dockerfile.rb', line 46 def initialize(source, dest, from: nil) @source = source @dest = dest @from = from end |
Instance Attribute Details
#dest ⇒ Object (readonly)
Returns the value of attribute dest.
44 45 46 |
# File 'lib/kuby/docker/dockerfile.rb', line 44 def dest @dest end |
#from ⇒ Object (readonly)
Returns the value of attribute from.
44 45 46 |
# File 'lib/kuby/docker/dockerfile.rb', line 44 def from @from end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
44 45 46 |
# File 'lib/kuby/docker/dockerfile.rb', line 44 def source @source end |
Instance Method Details
#to_s ⇒ Object
52 53 54 55 56 57 |
# File 'lib/kuby/docker/dockerfile.rb', line 52 def to_s cmd = ['COPY'] cmd << "--from=#{from}" if from cmd += [source, dest] cmd.join(' ') end |