Class: Jets::Cfn::Builder::Api::Resources
- Defined in:
- lib/jets/cfn/builder/api/resources.rb
Instance Method Summary collapse
- #add_gateway_resources ⇒ Object
- #add_rest_api_parameter ⇒ Object
-
#api_gateway_resource_class ⇒ Object
interface method.
-
#compose ⇒ Object
interface method.
- #part_of_template?(parent_path) ⇒ Boolean
-
#template_path ⇒ Object
interface method.
Methods inherited from Paged
build_pages, #initialize, pages_class
Methods inherited from Base
Methods included from AwsServices
#apigateway, #aws_lambda, #aws_options, #cfn, #dynamodb, #logs, #s3, #s3_resource, #sns, #sqs, #sts
Methods included from AwsServices::StackStatus
#lookup, #stack_exists?, #stack_in_progress?
Methods included from AwsServices::GlobalMemoist
Methods included from Interface
#add_description, #add_output, #add_outputs, #add_parameter, #add_parameters, #add_resource, #add_resources, #add_template_resource, #build, #build?, #template, #text, #write
Methods included from Util::Camelize
Constructor Details
This class inherits a constructor from Jets::Cfn::Builder::Api::Paged
Instance Method Details
#add_gateway_resources ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/jets/cfn/builder/api/resources.rb', line 18 def add_gateway_resources @items.each do |path| # IE: resource = Jets::Cfn::Resource::ApiGateway::Resource.new(path) next if path == '/' || path == '' # skip root path resource = api_gateway_resource_class.new(path) add_resource(resource) add_outputs(resource.outputs) parent_path = resource.parent_path_parameter add_parameter(parent_path) unless part_of_template?(parent_path) end end |
#add_rest_api_parameter ⇒ Object
14 15 16 |
# File 'lib/jets/cfn/builder/api/resources.rb', line 14 def add_rest_api_parameter add_parameter(:RestApi) end |
#api_gateway_resource_class ⇒ Object
interface method
32 33 34 |
# File 'lib/jets/cfn/builder/api/resources.rb', line 32 def api_gateway_resource_class Jets::Cfn::Resource::ApiGateway::Resource end |
#compose ⇒ Object
interface method
4 5 6 7 |
# File 'lib/jets/cfn/builder/api/resources.rb', line 4 def compose add_gateway_resources add_rest_api_parameter end |
#part_of_template?(parent_path) ⇒ Boolean
36 37 38 |
# File 'lib/jets/cfn/builder/api/resources.rb', line 36 def part_of_template?(parent_path) @template[:Resources].key?(parent_path) end |
#template_path ⇒ Object
interface method
10 11 12 |
# File 'lib/jets/cfn/builder/api/resources.rb', line 10 def template_path Jets::Names.api_resources_template_path(@page_number) end |