Class: Indocker::DockerDirectives::Copy
- Inherits:
-
Base
- Object
- Indocker::Directives::Base
- Base
- Indocker::DockerDirectives::Copy
- Defined in:
- lib/indocker/directives/docker_directives/copy.rb
Instance Attribute Summary collapse
-
#compile ⇒ Object
readonly
Returns the value of attribute compile.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#copy_actions ⇒ Object
readonly
Returns the value of attribute copy_actions.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(context:, copy_actions:, compile: false) ⇒ Copy
constructor
A new instance of Copy.
- #prepare_directive? ⇒ Boolean
- #to_s ⇒ Object
- #type ⇒ Object
Methods inherited from Indocker::Directives::Base
#build_directive?, #container_directive?, #partial?
Constructor Details
#initialize(context:, copy_actions:, compile: false) ⇒ Copy
Returns a new instance of Copy.
4 5 6 7 8 |
# File 'lib/indocker/directives/docker_directives/copy.rb', line 4 def initialize(context:, copy_actions:, compile: false) @copy_actions = copy_actions @context = context @compile = compile end |
Instance Attribute Details
#compile ⇒ Object (readonly)
Returns the value of attribute compile.
2 3 4 |
# File 'lib/indocker/directives/docker_directives/copy.rb', line 2 def compile @compile end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
2 3 4 |
# File 'lib/indocker/directives/docker_directives/copy.rb', line 2 def context @context end |
#copy_actions ⇒ Object (readonly)
Returns the value of attribute copy_actions.
2 3 4 |
# File 'lib/indocker/directives/docker_directives/copy.rb', line 2 def copy_actions @copy_actions end |
Instance Method Details
#prepare_directive? ⇒ Boolean
24 25 26 |
# File 'lib/indocker/directives/docker_directives/copy.rb', line 24 def prepare_directive? true end |
#to_s ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/indocker/directives/docker_directives/copy.rb', line 14 def to_s result = [] copy_actions.each do |from, to| result.push "#{type} #{from} #{to}" end result.join("\n") end |
#type ⇒ Object
10 11 12 |
# File 'lib/indocker/directives/docker_directives/copy.rb', line 10 def type 'COPY' end |