Sha256: e22779b04eb8a3ea63321ea041bc74e3975b1ccea0368834fc03faff501dc82f

Contents?: true

Size: 860 Bytes

Versions: 34

Compression:

Stored size: 860 Bytes

Contents

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

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

    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

34 entries across 34 versions & 1 rubygems

Version Path
cfndsl-0.4.4 lib/cfndsl/Resources.rb
cfndsl-0.4.3 lib/cfndsl/Resources.rb
cfndsl-0.4.2 lib/cfndsl/Resources.rb
cfndsl-0.4.1 lib/cfndsl/Resources.rb
cfndsl-0.4.0 lib/cfndsl/Resources.rb
cfndsl-0.3.6 lib/cfndsl/Resources.rb
cfndsl-0.3.5 lib/cfndsl/Resources.rb
cfndsl-0.3.4 lib/cfndsl/Resources.rb
cfndsl-0.3.3 lib/cfndsl/Resources.rb
cfndsl-0.3.2 lib/cfndsl/Resources.rb
cfndsl-0.3.1 lib/cfndsl/Resources.rb
cfndsl-0.2.9 lib/cfndsl/Resources.rb
cfndsl-0.2.8 lib/cfndsl/Resources.rb
cfndsl-0.3.0 lib/cfndsl/Resources.rb
cfndsl-0.2.7 lib/cfndsl/Resources.rb
cfndsl-0.2.4 lib/cfndsl/Resources.rb
cfndsl-0.2.3 lib/cfndsl/Resources.rb
cfndsl-0.2.2 lib/cfndsl/Resources.rb
cfndsl-0.2.1 lib/cfndsl/Resources.rb
cfndsl-0.2.0 lib/cfndsl/Resources.rb