Class: AWSCDK::MixinApplicator
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::MixinApplicator
- Defined in:
- mixin_applicator.rb
Overview
Applies mixins to constructs.
Class Method Summary collapse
Instance Method Summary collapse
-
#apply(*mixins) ⇒ AWSCDK::MixinApplicator
Applies a mixin to selected constructs.
-
#initialize(scope, selector = nil) ⇒ MixinApplicator
constructor
A new instance of MixinApplicator.
-
#report ⇒ Array<AWSCDK::MixinApplication>
Returns the successful mixin applications.
-
#require_all ⇒ AWSCDK::MixinApplicator
Requires all selected constructs to support the applied mixins.
-
#require_any ⇒ AWSCDK::MixinApplicator
Requires at least one mixin to be successfully applied.
-
#selected_constructs ⇒ Array<Constructs::IConstruct>
The constructs that match the selector in the given scope.
Constructor Details
#initialize(scope, selector = nil) ⇒ MixinApplicator
Returns a new instance of MixinApplicator.
10 11 12 13 14 |
# File 'mixin_applicator.rb', line 10 def initialize(scope, selector = nil) Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklDb25zdHJ1Y3QifQ==")), "scope") Jsii::Type.check_type(selector, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5JQ29uc3RydWN0U2VsZWN0b3IifQ==")), "selector") unless selector.nil? Jsii::Object.instance_method(:initialize).bind(self).call(scope, selector) end |
Class Method Details
.jsii_overridable_methods ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'mixin_applicator.rb', line 16 def self.jsii_overridable_methods { :report => { kind: :property, name: "report", is_optional: false }, :selected_constructs => { kind: :property, name: "selectedConstructs", is_optional: false }, :apply => { kind: :method, name: "apply", is_optional: false }, :require_all => { kind: :method, name: "requireAll", is_optional: false }, :require_any => { kind: :method, name: "requireAny", is_optional: false }, } end |
Instance Method Details
#apply(*mixins) ⇒ AWSCDK::MixinApplicator
Applies a mixin to selected constructs.
44 45 46 47 48 49 |
# File 'mixin_applicator.rb', line 44 def apply(*mixins) mixins.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]") end jsii_call_method("apply", [*mixins]) end |
#report ⇒ Array<AWSCDK::MixinApplication>
Returns the successful mixin applications.
29 30 31 |
# File 'mixin_applicator.rb', line 29 def report() jsii_get_property("report") end |
#require_all ⇒ AWSCDK::MixinApplicator
Requires all selected constructs to support the applied mixins.
Will only check for future call of apply().
Set this before calling apply() to take effect.
59 60 61 |
# File 'mixin_applicator.rb', line 59 def require_all() jsii_call_method("requireAll", []) end |
#require_any ⇒ AWSCDK::MixinApplicator
Requires at least one mixin to be successfully applied.
Will only check for future call of apply().
Set this before calling apply() to take effect.
71 72 73 |
# File 'mixin_applicator.rb', line 71 def require_any() jsii_call_method("requireAny", []) end |
#selected_constructs ⇒ Array<Constructs::IConstruct>
The constructs that match the selector in the given scope.
36 37 38 |
# File 'mixin_applicator.rb', line 36 def selected_constructs() jsii_get_property("selectedConstructs") end |