Class: CloudFormation::MainGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/svrless/generators/cloud_formation/main_generator.rb

Overview

The main outer shell of SAM template generators

Constant Summary collapse

AWS_TEMPLATE_VERSION =
"2010-09-09"
AWS_TRANSFORM_VERSION =
"AWS::Serverless-2016-10-31"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klasses:, actions:) ⇒ MainGenerator

Returns a new instance of MainGenerator.



15
16
17
18
# File 'lib/svrless/generators/cloud_formation/main_generator.rb', line 15

def initialize(klasses:, actions:)
  @klasses = klasses
  @actions = actions
end

Instance Attribute Details

#actionsObject

Returns the value of attribute actions.



13
14
15
# File 'lib/svrless/generators/cloud_formation/main_generator.rb', line 13

def actions
  @actions
end

#klassesObject

Returns the value of attribute klasses.



13
14
15
# File 'lib/svrless/generators/cloud_formation/main_generator.rb', line 13

def klasses
  @klasses
end

Instance Method Details

#hash_representationObject



24
25
26
# File 'lib/svrless/generators/cloud_formation/main_generator.rb', line 24

def hash_representation
  main_template_hash
end

#representationObject



20
21
22
# File 'lib/svrless/generators/cloud_formation/main_generator.rb', line 20

def representation
  main_template_hash.deep_transform_keys { |k| k.to_s.capitalize.camelize }.to_yaml
end