Class: CfnModel::TransformRegistry
- Inherits:
-
Object
- Object
- CfnModel::TransformRegistry
- Defined in:
- lib/cfn-model/parser/transform_registry.rb
Overview
TransformRegistry provides a registry of CloudFormation transforms available for templates
Instance Attribute Summary collapse
-
#registry ⇒ Object
readonly
Returns the value of attribute registry.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ TransformRegistry
constructor
A new instance of TransformRegistry.
- #perform_transforms(cfn_hash) ⇒ Object
Constructor Details
#initialize ⇒ TransformRegistry
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
#registry ⇒ Object (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
.instance ⇒ Object
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 |