Sha256: c51f294658a9aa67206fe08da3cf88b4e84f20b27f138332050779dd70e852ff

Contents?: true

Size: 901 Bytes

Versions: 20

Compression:

Stored size: 901 Bytes

Contents

class Jets::Stack
  class Depends
    autoload :Item, "jets/stack/depends/item"

    def initialize(items)
      @items = items
    end

    def params
      result = {}
      @items.each do |item|
        logical_id = item.stack.to_s.camelize # logical_id
        dependency_outputs(logical_id).each do |output|
          dependency_class = logical_id.to_s.classify
          output_key = item.options[:class_prefix] ?
            "#{dependency_class}#{output}" : # already camelized
            output

          output_value = "!GetAtt #{dependency_class}.Outputs.#{output}"
          result[output_key] = output_value
        end
      end
      result
    end

    def stack_list
      @items.map do |item|
        item.stack.to_s.camelize # logical_id # logical_id
      end
    end

    def dependency_outputs(logical_id)
      logical_id.to_s.classify.constantize.output_keys
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
jets-1.9.4 lib/jets/stack/depends.rb
jets-1.9.3 lib/jets/stack/depends.rb
jets-1.9.2 lib/jets/stack/depends.rb
jets-1.9.1 lib/jets/stack/depends.rb
jets-1.9.0 lib/jets/stack/depends.rb
jets-1.8.14 lib/jets/stack/depends.rb
jets-1.8.13 lib/jets/stack/depends.rb
jets-1.8.12 lib/jets/stack/depends.rb
jets-1.8.11 lib/jets/stack/depends.rb
jets-1.8.10 lib/jets/stack/depends.rb
jets-1.8.9 lib/jets/stack/depends.rb
jets-1.8.8 lib/jets/stack/depends.rb
jets-1.8.7 lib/jets/stack/depends.rb
jets-1.8.6 lib/jets/stack/depends.rb
jets-1.8.5 lib/jets/stack/depends.rb
jets-1.8.4 lib/jets/stack/depends.rb
jets-1.8.3 lib/jets/stack/depends.rb
jets-1.8.2 lib/jets/stack/depends.rb
jets-1.8.1 lib/jets/stack/depends.rb
jets-1.8.0 lib/jets/stack/depends.rb