Class: Convection::Model::Template::Mapping

Inherits:
Object
  • Object
show all
Includes:
DSL::Helpers
Defined in:
lib/convection/model/template/mapping.rb

Overview

Mapping

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DSL::Helpers

#camel_case, included, method_name, #screaming_snake_case, #snake_case

Methods included from DSL::IntrinsicFunctions

#base64, #find_in_map, #fn_and, #fn_equals, #fn_if, #fn_not, #fn_or, #fn_ref, #get_att, #get_azs, #join, #select

Constructor Details

#initialize(name, parent) ⇒ Mapping

Returns a new instance of Mapping



26
27
28
29
30
31
# File 'lib/convection/model/template/mapping.rb', line 26

def initialize(name, parent)
  @name = name
  @template = parent.template

  @items = Smash.new
end

Instance Attribute Details

#itemsObject (readonly)

Returns the value of attribute items



23
24
25
# File 'lib/convection/model/template/mapping.rb', line 23

def items
  @items
end

#templateObject (readonly)

Returns the value of attribute template



24
25
26
# File 'lib/convection/model/template/mapping.rb', line 24

def template
  @template
end

Instance Method Details

#item(key_1, key_2, value) ⇒ Object



33
34
35
# File 'lib/convection/model/template/mapping.rb', line 33

def item(key_1, key_2, value)
  items[key_1][key_2] = value
end

#renderObject



37
38
39
# File 'lib/convection/model/template/mapping.rb', line 37

def render
  items
end