Class: CfnModel::TransformRegistry

Inherits:
Object
  • Object
show all
Defined in:
lib/cfn-model/parser/transform_registry.rb

Overview

TransformRegistry provides a registry of CloudFormation transforms available for templates

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTransformRegistry

Returns a new instance of TransformRegistry.



13
14
15
16
17
# File 'lib/cfn-model/parser/transform_registry.rb', line 13

def initialize
  @registry = {
    'AWS::Serverless-2016-10-31' => CfnModel::Transforms::Serverless
  }
end

Instance Attribute Details

#registryObject (readonly)

Returns the value of attribute registry.



11
12
13
# File 'lib/cfn-model/parser/transform_registry.rb', line 11

def registry
  @registry
end

Class Method Details

.instanceObject



25
26
27
28
# File 'lib/cfn-model/parser/transform_registry.rb', line 25

def self.instance
  @instance ||= TransformRegistry.new
  @instance
end

Instance Method Details

#perform_transforms(cfn_hash) ⇒ Object



19
20
21
22
23
# File 'lib/cfn-model/parser/transform_registry.rb', line 19

def perform_transforms(cfn_hash)
  transform_name = cfn_hash['Transform']
  return unless transform_name && @registry[transform_name]
  @registry[transform_name].instance.perform_transform cfn_hash
end