Class: AWSCDK::Aspects
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::Aspects
- Defined in:
- aspects.rb
Overview
Aspects can be applied to CDK tree scopes and can operate on the tree before synthesis.
Class Method Summary collapse
- .jsii_overridable_methods ⇒ Object
-
.of(scope) ⇒ AWSCDK::Aspects
Returns the
Aspectsobject associated with a construct scope.
Instance Method Summary collapse
-
#add(aspect, options = nil) ⇒ void
Adds an aspect to apply this scope before synthesis.
-
#all ⇒ Array<AWSCDK::IAspect>
The list of aspects which were directly applied on this scope.
-
#applied ⇒ Array<AWSCDK::AspectApplication>
The list of aspects with priority which were directly applied on this scope.
-
#initialize(*args) ⇒ Aspects
constructor
A new instance of Aspects.
Constructor Details
#initialize(*args) ⇒ Aspects
Returns a new instance of Aspects.
8 9 10 |
# File 'aspects.rb', line 8 def initialize(*args) raise NoMethodError, "aws-cdk-lib.Aspects does not have a visible constructor; use the provided factory methods" end |
Class Method Details
.jsii_overridable_methods ⇒ Object
12 13 14 15 16 17 18 |
# File 'aspects.rb', line 12 def self.jsii_overridable_methods { :all => { kind: :property, name: "all", is_optional: false }, :applied => { kind: :property, name: "applied", is_optional: false }, :add => { kind: :method, name: "add", is_optional: false }, } end |
.of(scope) ⇒ AWSCDK::Aspects
Returns the Aspects object associated with a construct scope.
24 25 26 27 |
# File 'aspects.rb', line 24 def self.of(scope) Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklDb25zdHJ1Y3QifQ==")), "scope") Jsii::Kernel.instance.call_static("aws-cdk-lib.Aspects", "of", [scope]) end |
Instance Method Details
#add(aspect, options = nil) ⇒ void
This method returns an undefined value.
Adds an aspect to apply this scope before synthesis.
50 51 52 53 54 55 |
# File 'aspects.rb', line 50 def add(aspect, = nil) Jsii::Type.check_type(aspect, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5JQXNwZWN0In0=")), "aspect") = .is_a?(Hash) ? ::AWSCDK::AspectOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5Bc3BlY3RPcHRpb25zIn0=")), "options") unless .nil? jsii_call_method("add", [aspect, ]) end |
#all ⇒ Array<AWSCDK::IAspect>
The list of aspects which were directly applied on this scope.
32 33 34 |
# File 'aspects.rb', line 32 def all() jsii_get_property("all") end |
#applied ⇒ Array<AWSCDK::AspectApplication>
The list of aspects with priority which were directly applied on this scope.
Also returns inherited Aspects of this node.
41 42 43 |
# File 'aspects.rb', line 41 def applied() jsii_get_property("applied") end |