Sha256: e239ac1b5e88960fc9243a29d42548c6bef951c3a5d8b3bff5c3a2fd2c8ed183
Contents?: true
Size: 1.15 KB
Versions: 60
Compression:
Stored size: 1.15 KB
Contents
module Jets::Cfn::Builders class ApiResourcesBuilder include Interface include Jets::AwsServices def initialize(options={}, paths=[], page) @options, @paths, @page = options, paths, page @template = ActiveSupport::HashWithIndifferentAccess.new(Resources: {}) end # compose is an interface method def compose add_rest_api_parameter add_gateway_routes end # template_path is an interface method def template_path Jets::Naming.api_resources_template_path(@page) end def add_rest_api_parameter add_parameter("RestApi", Description: "RestApi") end def add_gateway_routes @paths.each do |path| homepage = path == '' next if homepage # handled by RootResourceId output already resource = Jets::Resource::ApiGateway::Resource.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 def part_of_template?(parent_path) @template["Resources"].key?(parent_path) end end end
Version data entries
60 entries across 60 versions & 2 rubygems