Sha256: e11845a271722c859e93b48c99b73cafe359fa9f70e4800c1d9853a0b7713e79

Contents?: true

Size: 789 Bytes

Versions: 5

Compression:

Stored size: 789 Bytes

Contents

require 'cfndsl/JSONable'
require 'cfndsl/Metadata'
require 'cfndsl/Properties'

module CfnDsl  
  class ResourceDefinition < JSONable
    ##
    # Handles Resource objects
    dsl_attr_setter :Type, :DependsOn, :DeletionPolicy
    dsl_content_object :Property, :Metadata

    def addTag(name, value, propagate=nil)
      self.send(:Tag) {
        Key name
        Value value
        PropagateAtLaunch propagate unless propagate.nil?
      }
    end

    def get_references()
      refs = []
      if @DependsOn then
        if( @DependsOn.respond_to?(:each) ) then
          @DependsOn.each do |dep|
            refs.push dep
          end
        end

        if( @DependsOn.instance_of?(String) ) then
          refs.push @DependsOn 
        end
      end
      refs
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cfndsl-0.0.16 lib/cfndsl/Resources.rb
cfndsl-0.0.15 lib/cfndsl/Resources.rb
cfndsl-0.0.14 lib/cfndsl/Resources.rb
cfndsl-0.0.13 lib/cfndsl/Resources.rb
cfndsl-0.0.12 lib/cfndsl/Resources.rb