Class: Jets::Cfn::Builders::ControllerBuilder
- Inherits:
-
BaseChildBuilder
- Object
- BaseChildBuilder
- Jets::Cfn::Builders::ControllerBuilder
- Defined in:
- lib/jets/cfn/builders/controller_builder.rb
Instance Method Summary collapse
- #add_api_gateway_parameters ⇒ Object
- #add_routes ⇒ Object
-
#compose ⇒ Object
compose is an interface method for Interface module.
-
#scoped_routes ⇒ Object
routes scoped to this controller template.
Methods inherited from BaseChildBuilder
#add_class_iam_policy, #add_common_parameters, #add_function, #add_function_iam_policy, #add_functions, #dependency_outputs, #depends_on_params, #initialize, #template_path
Methods included from Interface
#add_output, #add_outputs, #add_parameter, #add_parameters, #add_resource, #add_resources, #add_template_resource, #build, #post_process_template, #template, #text, #write
Constructor Details
This class inherits a constructor from Jets::Cfn::Builders::BaseChildBuilder
Instance Method Details
#add_api_gateway_parameters ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/jets/cfn/builders/controller_builder.rb', line 16 def add_api_gateway_parameters return if Jets::Router.routes.empty? add_parameter("RestApi", Description: "RestApi") scoped_routes.each do |route| resource = Jets::Resource::ApiGateway::Resource.new(route.path) add_parameter(resource.logical_id, Description: resource.desc) end end |
#add_routes ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/jets/cfn/builders/controller_builder.rb', line 26 def add_routes scoped_routes.each_with_index do |route, i| method = Jets::Resource::ApiGateway::Method.new(route) add_resource(method) add_resource(method.) add_resource(method.cors) if Jets.config.cors end end |
#compose ⇒ Object
compose is an interface method for Interface module
9 10 11 12 13 14 |
# File 'lib/jets/cfn/builders/controller_builder.rb', line 9 def compose add_common_parameters add_api_gateway_parameters add_functions add_routes end |