Method: Sfn::CommandModule::Template::InstanceMethods#template_content

Defined in:
lib/sfn/command_module/template.rb

#template_content(thing, scrub = false) ⇒ Hash

Extract template content based on type

Parameters:

  • thing (SparkleFormation, Hash)
  • scrub (Truthy, Falsey) (defaults to: false)

    scrub nested templates

Returns:

  • (Hash)


25
26
27
28
29
30
31
32
33
34
35
# File 'lib/sfn/command_module/template.rb', line 25

def template_content(thing, scrub = false)
  if thing.is_a?(SparkleFormation)
    if scrub
      dump_stack_for_storage(thing)
    else
      config[:sparkle_dump] ? thing.sparkle_dump : thing.dump
    end
  else
    thing
  end
end