Class: Constructs::Dependable

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

Overview

Trait for IDependable.

Traits are interfaces that are privately implemented by objects. Instead of showing up in the public interface of a class, they need to be queried explicitly. This is used to implement certain framework features that are not intended to be used by Construct consumers, and so should be hidden from accidental use.

Examples:

// Usage
const roots = Dependable.of(construct).dependencyRoots;

// Definition
Dependable.implement(construct, {
      dependencyRoots: [construct],
});

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&jsii_block) ⇒ Dependable

Returns a new instance of Dependable.



23
24
25
# File 'dependable.rb', line 23

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

Class Method Details

.get(instance) ⇒ Constructs::Dependable

Deprecated.

use of

Return the matching Dependable for the given class instance.

Parameters:

Returns:

  • (Constructs::Dependable)


38
39
40
41
# File 'dependable.rb', line 38

def self.get(instance)
  Jsii::Type.check_type(instance, "eyJmcW4iOiJjb25zdHJ1Y3RzLklEZXBlbmRhYmxlIn0=", "instance")
  Jsii::Kernel.instance.call_static("constructs.Dependable", "get", [instance])
end

.implement(instance, trait) ⇒ void

This method returns an undefined value.

Turn any object into an IDependable.

Parameters:



48
49
50
51
52
# File 'dependable.rb', line 48

def self.implement(instance, trait)
  Jsii::Type.check_type(instance, "eyJmcW4iOiJjb25zdHJ1Y3RzLklEZXBlbmRhYmxlIn0=", "instance")
  Jsii::Type.check_type(trait, "eyJmcW4iOiJjb25zdHJ1Y3RzLkRlcGVuZGFibGUifQ==", "trait")
  Jsii::Kernel.instance.call_static("constructs.Dependable", "implement", [instance, trait])
end

.jsii_overridable_methodsObject



27
28
29
30
31
# File 'dependable.rb', line 27

def self.jsii_overridable_methods
  {
    :dependency_roots => { kind: :property, name: "dependencyRoots", is_optional: false },
  }
end

.of(instance) ⇒ Constructs::Dependable

Return the matching Dependable for the given class instance.

Parameters:

Returns:

  • (Constructs::Dependable)


58
59
60
61
# File 'dependable.rb', line 58

def self.of(instance)
  Jsii::Type.check_type(instance, "eyJmcW4iOiJjb25zdHJ1Y3RzLklEZXBlbmRhYmxlIn0=", "instance")
  Jsii::Kernel.instance.call_static("constructs.Dependable", "of", [instance])
end

Instance Method Details

#dependency_rootsArray<Constructs::IConstruct>

The set of constructs that form the root of this dependable.

All resources under all returned constructs are included in the ordering dependency.

Returns:



69
70
71
# File 'dependable.rb', line 69

def dependency_roots()
  jsii_get_property("dependencyRoots")
end