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.



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

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

Instance Attribute Details

#registryObject (readonly)

Returns the value of attribute registry.



9
10
11
# File 'lib/cfn-model/parser/transform_registry.rb', line 9

def registry
  @registry
end

Class Method Details

.instanceObject



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

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

Instance Method Details

#perform_transforms(cfn_hash) ⇒ Object



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

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