Class: Cumuliform::Template

Inherits:
Object
  • Object
show all
Includes:
DSL::Fragments, DSL::Functions, DSL::Helpers, DSL::Import, Output, Sections
Defined in:
lib/cumuliform/template.rb,
lib/cumuliform/dsl.rb

Overview

Represents a single CloudFormation template

Instance Method Summary collapse

Methods included from Sections

#get_section, #initialize

Methods included from Output

#to_hash, #to_json

Methods included from DSL::Helpers

#helpers

Methods included from DSL::Functions

#fn, #ref, #xref

Methods included from DSL::Fragments

#def_fragment, #find_fragment, #fragment

Methods included from DSL::Import

#has_logical_id?, #import, #verify_logical_id!

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Cumuliform::DSL::Helpers

Instance Method Details

#define(&block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



35
36
37
38
# File 'lib/cumuliform/template.rb', line 35

def define(&block)
  instance_exec(&block)
  self
end

#description(desc) ⇒ Object



25
26
27
# File 'lib/cumuliform/template.rb', line 25

def description(desc)
  @Description = desc
end

#get_top_level_value(item_name) ⇒ Object

Raises:

  • (ArgumentError)


29
30
31
32
# File 'lib/cumuliform/template.rb', line 29

def get_top_level_value(item_name)
  raise ArgumentError, "Not an allowed top-level item name" unless TOP_LEVEL.include?(item_name)
  instance_variable_get(:"@#{item_name}")
end

#transform(transform) ⇒ Object



21
22
23
# File 'lib/cumuliform/template.rb', line 21

def transform(transform)
  @Transform = transform
end