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.1.20 lib/cfndsl/Resources.rb
cfndsl-0.1.19 lib/cfndsl/Resources.rb
cfndsl-0.1.18 lib/cfndsl/Resources.rb
cfndsl-0.1.17 lib/cfndsl/Resources.rb
cfndsl-0.1.16 lib/cfndsl/Resources.rb
cfndsl-0.1.15 lib/cfndsl/Resources.rb
cfndsl-0.1.14 lib/cfndsl/Resources.rb
cfndsl-0.1.13 lib/cfndsl/Resources.rb
cfndsl-0.1.12 lib/cfndsl/Resources.rb
cfndsl-0.1.11 lib/cfndsl/Resources.rb
cfndsl-0.1.10 lib/cfndsl/Resources.rb
cfndsl-0.1.9 lib/cfndsl/Resources.rb
cfndsl-0.1.8 lib/cfndsl/Resources.rb
cfndsl-0.1.7 lib/cfndsl/Resources.rb