Class: Jets::Cfn::TemplateMappers::ControllerMapper
- Inherits:
-
ChildMapper
- Object
- ChildMapper
- Jets::Cfn::TemplateMappers::ControllerMapper
- Defined in:
- lib/jets/cfn/template_mappers/controller_mapper.rb
Instance Attribute Summary
Attributes inherited from ChildMapper
Instance Method Summary collapse
-
#current_class ⇒ Object
Example: 1.
-
#parameters ⇒ Object
Parameters that are common to all controller stacks.
- #scoped_routes ⇒ Object
Methods inherited from ChildMapper
#initialize, #logical_id, #template_url
Constructor Details
This class inherits a constructor from Jets::Cfn::TemplateMappers::ChildMapper
Instance Method Details
#current_class ⇒ Object
Example:
1. demo-stag-admin-.yml
2. admin/posts_controller
3. Admin::PostsController
28 29 30 31 32 33 34 |
# File 'lib/jets/cfn/template_mappers/controller_mapper.rb', line 28 def current_class templates_prefix = "#{Jets::Naming.template_path_prefix}-" @path.sub(templates_prefix, '') .sub(/\.yml$/,'') .gsub('-','/') .classify end |
#parameters ⇒ Object
Parameters that are common to all controller stacks
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/jets/cfn/template_mappers/controller_mapper.rb', line 4 def parameters parameters = super return parameters if Jets::Router.routes.empty? # Add the API Gateway parameters parameters[:RestApi] = "!GetAtt ApiGateway.Outputs.RestApi" scoped_routes.each do |route| map = GatewayResourceMapper.new(route.path) parameters[map.logical_id] = "!GetAtt ApiGateway.Outputs.#{map.logical_id}" end parameters end |