Class: Holodekk::Image::Instructions::Arg
- Inherits:
-
Builder::Instruction
- Object
- Builder::Instruction
- Holodekk::Image::Instructions::Arg
- Defined in:
- lib/holodekk/image/instructions/arg.rb
Instance Attribute Summary collapse
-
#arg ⇒ Object
Returns the value of attribute arg.
-
#default ⇒ Object
Returns the value of attribute default.
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Builder::Instruction
#as_json, instruction_tag, tag, #tag, #to_json
Instance Attribute Details
#arg ⇒ Object
Returns the value of attribute arg.
7 8 9 |
# File 'lib/holodekk/image/instructions/arg.rb', line 7 def arg @arg end |
#default ⇒ Object
Returns the value of attribute default.
7 8 9 |
# File 'lib/holodekk/image/instructions/arg.rb', line 7 def default @default end |
Class Method Details
.build(arg, **kwargs) ⇒ Object
11 12 13 |
# File 'lib/holodekk/image/instructions/arg.rb', line 11 def self.build(arg, **kwargs) new({ arg: arg }.merge(kwargs)) end |
Instance Method Details
#to_dockerfile ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/holodekk/image/instructions/arg.rb', line 15 def to_dockerfile builder = Docker::Dockerfile::InstructionBuilder.new(self) if default.nil? builder.raw_value(arg) else builder.key_pair(arg, default) end builder.output end |