Class: Kozo::Operations::Show
Instance Attribute Summary
#resource
Instance Method Summary
collapse
#initialize
Instance Method Details
#apply(state) ⇒ Object
9
|
# File 'lib/kozo/operations/show.rb', line 9
def apply(state); end
|
#to_s ⇒ Object
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/kozo/operations/show.rb', line 11
def to_s
l = resource.attribute_names.map(&:length).max || 1
attrs = resource
.attributes
.map { |k, v| " r.#{k.to_s.ljust(l)} = #{v.as_s.indent(2)[2..]}" }
.join("\n")
<<~DSL.chomp
#{"# #{resource.address}:".bold}
resource "#{resource.resource_name}", "#{resource.state_name}" do |r|
#{attrs}
end
DSL
end
|