Class: Holodekk::Image::Instructions::Label
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
instruction_tag, tag, #tag, #to_json
Instance Attribute Details
#labels ⇒ Object
Returns the value of attribute labels.
7
8
9
|
# File 'lib/holodekk/image/instructions/label.rb', line 7
def labels
@labels
end
|
Class Method Details
.build(labels) ⇒ Object
11
12
13
|
# File 'lib/holodekk/image/instructions/label.rb', line 11
def self.build(labels)
new({ labels: labels })
end
|
Instance Method Details
#as_json(options = {}) ⇒ Object
15
|
# File 'lib/holodekk/image/instructions/label.rb', line 15
def as_json(options = {}); end
|
#to_dockerfile ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/holodekk/image/instructions/label.rb', line 17
def to_dockerfile
builder = Docker::Dockerfile::InstructionBuilder.new(self)
lines = labels.each_pair.map do |key, value|
builder.key_pair(
Docker::Dockerfile::InstructionBuilder::QuotedString.new(key),
Docker::Dockerfile::InstructionBuilder::QuotedString.new(value)
)
builder.output!
end
lines.join("\n")
end
|