Class: Holodekk::Image::Instructions::Run::Options::WithSecretMount::OptionBuilder
- Inherits:
-
Object
- Object
- Holodekk::Image::Instructions::Run::Options::WithSecretMount::OptionBuilder
- Defined in:
- lib/holodekk/image/instructions/run/options/with_secret_mount.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#pairs ⇒ Object
Returns the value of attribute pairs.
Instance Method Summary collapse
- #build(&block) ⇒ Object
-
#initialize(name) ⇒ OptionBuilder
constructor
A new instance of OptionBuilder.
- #output ⇒ Object
- #pair(key, value) ⇒ Object
Constructor Details
#initialize(name) ⇒ OptionBuilder
Returns a new instance of OptionBuilder.
33 34 35 36 |
# File 'lib/holodekk/image/instructions/run/options/with_secret_mount.rb', line 33 def initialize(name) @name = name @pairs = [] end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
31 32 33 |
# File 'lib/holodekk/image/instructions/run/options/with_secret_mount.rb', line 31 def name @name end |
#pairs ⇒ Object
Returns the value of attribute pairs.
31 32 33 |
# File 'lib/holodekk/image/instructions/run/options/with_secret_mount.rb', line 31 def pairs @pairs end |
Instance Method Details
#build(&block) ⇒ Object
38 39 40 |
# File 'lib/holodekk/image/instructions/run/options/with_secret_mount.rb', line 38 def build(&block) instance_eval(&block) end |
#output ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/holodekk/image/instructions/run/options/with_secret_mount.rb', line 46 def output chunks = ["--#{name}"] pairs.each do |pair| chunks << "#{pair[0]}=#{pair[1]}" end chunks.join(',') end |
#pair(key, value) ⇒ Object
42 43 44 |
# File 'lib/holodekk/image/instructions/run/options/with_secret_mount.rb', line 42 def pair(key, value) pairs << [key, value] end |