Class: CfnDsl::MappingDefinition

Inherits:
JSONable
  • Object
show all
Defined in:
lib/cfndsl/Mappings.rb

Instance Method Summary collapse

Methods inherited from JSONable

#declare, #incorrect_capitalization?, #method_missing, #ref_children, #titleize

Methods included from Functions

#FnAnd, #FnBase64, #FnEquals, #FnFindInMap, #FnFormat, #FnGetAZs, #FnGetAtt, #FnIf, #FnJoin, #FnNot, #FnOr, #FnSelect, #Ref

Methods included from RefCheck

#ref_children, #references

Constructor Details

#initialize(value) ⇒ MappingDefinition

Handles mapping objects

Usage:

 Mapping("AWSRegionArch2AMI", {
           "us-east-1" => { "32" => "ami-6411e20d", "64" => "ami-7a11e213" },
           "us-west-1" => { "32" => "ami-c9c7978c", "64" => "ami-cfc7978a" },
           "eu-west-1" => { "32" => "ami-37c2f643", "64" => "ami-31c2f645" },
           "ap-southeast-1" => { "32" => "ami-66f28c34", "64" => "ami-60f28c32" },
           "ap-northeast-1" => { "32" => "ami-9c03a89d", "64" => "ami-a003a8a1" }
})

17
18
19
# File 'lib/cfndsl/Mappings.rb', line 17

def initialize(value)
  @value = value
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class CfnDsl::JSONable

Instance Method Details

#to_json(*a) ⇒ Object


21
22
23
# File 'lib/cfndsl/Mappings.rb', line 21

def to_json(*a)
  @value.to_json(*a)
end