class Jets::Cfn::Builders::ApiResourcesBuilder

def add_gateway_routes

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 add_rest_api_parameter

def add_rest_api_parameter
  add_parameter("RestApi", Description: "RestApi")
end

def compose

compose is an interface method
def compose
  add_rest_api_parameter
  add_gateway_routes
end

def initialize(options={}, paths=[], page)

def initialize(options={}, paths=[], page)
  @options, @paths, @page = options, paths, page
  @template = ActiveSupport::HashWithIndifferentAccess.new(Resources: {})
end

def part_of_template?(parent_path)

def part_of_template?(parent_path)
  @template["Resources"].key?(parent_path)
end

def template_path

template_path is an interface method
def template_path
  Jets::Naming.api_resources_template_path(@page)
end