Sha256: bec3371148e32c4182c1bca45419384a25a397787c85d9655d73f99ed9c950fc

Contents?: true

Size: 821 Bytes

Versions: 5

Compression:

Stored size: 821 Bytes

Contents

class Jets::Cfn::Builders
  class ApiDeploymentBuilder
    include Interface
    include Jets::AwsServices

    def initialize(options={})
      @options = options
      @template = ActiveSupport::HashWithIndifferentAccess.new(Resources: {})
    end

    # compose is an interface method
    def compose
      return unless @options[:full] || @options[:stack_type] != :minimal

      deployment = Jets::Resource::ApiGateway::Deployment.new
      add_resource(deployment)
      add_parameters(deployment.parameters)
      add_outputs(deployment.outputs)
    end

    # template_path is an interface method
    def template_path
      Jets::Naming.api_deployment_template_path
    end

    # do not bother writing a template if routes are empty
    def write
      super unless Jets::Router.routes.empty?
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
jets-0.10.1 lib/jets/cfn/builders/api_deployment_builder.rb
jets-0.10.0 lib/jets/cfn/builders/api_deployment_builder.rb
jets-0.9.2 lib/jets/cfn/builders/api_deployment_builder.rb
jets-0.9.1 lib/jets/cfn/builders/api_deployment_builder.rb
jets-0.9.0 lib/jets/cfn/builders/api_deployment_builder.rb