Class: Holodekk::Image::Instructions::Run::Options::WithSecretMount::OptionBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/holodekk/image/instructions/run/options/with_secret_mount.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject

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

#pairsObject

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

#outputObject



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