Class: AWSCDK::TreeInspector

Inherits:
Jsii::Object
  • Object
show all
Defined in:
tree_inspector.rb

Overview

Inspector that maintains an attribute bag.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTreeInspector

Returns a new instance of TreeInspector.



8
9
10
# File 'tree_inspector.rb', line 8

def initialize
  Jsii::Object.instance_method(:initialize).bind(self).call
end

Class Method Details

.jsii_overridable_methodsObject



12
13
14
15
16
17
# File 'tree_inspector.rb', line 12

def self.jsii_overridable_methods
  {
    :attributes => { kind: :property, name: "attributes", is_optional: false },
    :add_attribute => { kind: :method, name: "addAttribute", is_optional: false },
  }
end

Instance Method Details

#add_attribute(key, value) ⇒ void

This method returns an undefined value.

Adds attribute to bag.

Keys should be added by convention to prevent conflicts i.e. L1 constructs will contain attributes with keys prefixed with aws:cdk:cloudformation

Parameters:

  • key (String)
    • key for metadata.
  • value (Object)
    • value of metadata.


34
35
36
37
38
# File 'tree_inspector.rb', line 34

def add_attribute(key, value)
  Jsii::Type.check_type(key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "key")
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "value")
  jsii_call_method("addAttribute", [key, value])
end

#attributesHash{String => Object}

Represents the bag of attributes as key-value pairs.

Returns:

  • (Hash{String => Object})


22
23
24
# File 'tree_inspector.rb', line 22

def attributes()
  jsii_get_property("attributes")
end