Class: AWSCDK::Reference
- Inherits:
-
Intrinsic
- Object
- Intrinsic
- AWSCDK::Reference
- Defined in:
- reference.rb
Overview
An intrinsic Token that represents a reference to a construct.
References are recorded.
Class Method Summary collapse
-
.is_reference(x) ⇒ Boolean
Check whether this is actually a Reference.
- .jsii_overridable_methods ⇒ Object
Instance Method Summary collapse
-
#creation_stack ⇒ Array<String>
The captured stack trace which represents the location in which this token was created.
- #display_name ⇒ String
-
#initialize(value, target, display_name = nil, type_hint = nil) ⇒ Reference
constructor
A new instance of Reference.
-
#new_error(message) ⇒ Object
Creates a throwable Error object that contains the token creation stack trace.
-
#resolve(_context) ⇒ Object
Produce the Token's value at resolution time.
- #target ⇒ Constructs::IConstruct
-
#to_json ⇒ Object
Turn this Token into JSON.
-
#to_string ⇒ String
Convert an instance of this Token to a string.
-
#to_string_list ⇒ Array<String>
Convert an instance of this Token to a string list.
-
#type_hint ⇒ AWSCDK::ResolutionTypeHint?
Type that the Intrinsic is expected to evaluate to.
Constructor Details
#initialize(value, target, display_name = nil, type_hint = nil) ⇒ Reference
Returns a new instance of Reference.
14 15 16 17 18 19 20 |
# File 'reference.rb', line 14 def initialize(value, target, display_name = nil, type_hint = nil) Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "value") Jsii::Type.check_type(target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklDb25zdHJ1Y3QifQ==")), "target") Jsii::Type.check_type(display_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "displayName") unless display_name.nil? Jsii::Type.check_type(type_hint, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZXNvbHV0aW9uVHlwZUhpbnQifQ==")), "typeHint") unless type_hint.nil? Jsii::Object.instance_method(:initialize).bind(self).call(value, target, display_name, type_hint) end |
Class Method Details
.is_reference(x) ⇒ Boolean
Check whether this is actually a Reference.
40 41 42 43 |
# File 'reference.rb', line 40 def self.is_reference(x) Jsii::Type.check_type(x, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "x") Jsii::Kernel.instance.call_static("aws-cdk-lib.Reference", "isReference", [x]) end |
.jsii_overridable_methods ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'reference.rb', line 22 def self.jsii_overridable_methods { :creation_stack => { kind: :property, name: "creationStack", is_optional: false }, :type_hint => { kind: :property, name: "typeHint", is_optional: true }, :display_name => { kind: :property, name: "displayName", is_optional: false }, :target => { kind: :property, name: "target", is_optional: false }, :new_error => { kind: :method, name: "newError", is_optional: false }, :resolve => { kind: :method, name: "resolve", is_optional: false }, :to_json => { kind: :method, name: "toJSON", is_optional: false }, :to_string => { kind: :method, name: "toString", is_optional: false }, :to_string_list => { kind: :method, name: "toStringList", is_optional: false }, } end |
Instance Method Details
#creation_stack ⇒ Array<String>
The captured stack trace which represents the location in which this token was created.
48 49 50 |
# File 'reference.rb', line 48 def creation_stack() jsii_get_property("creationStack") end |
#display_name ⇒ String
60 61 62 |
# File 'reference.rb', line 60 def display_name() jsii_get_property("displayName") end |
#new_error(message) ⇒ Object
Creates a throwable Error object that contains the token creation stack trace.
73 74 75 76 |
# File 'reference.rb', line 73 def new_error() Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "message") jsii_call_method("newError", []) end |
#resolve(_context) ⇒ Object
Produce the Token's value at resolution time.
82 83 84 85 |
# File 'reference.rb', line 82 def resolve(_context) Jsii::Type.check_type(_context, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5JUmVzb2x2ZUNvbnRleHQifQ==")), "_context") jsii_call_method("resolve", [_context]) end |
#target ⇒ Constructs::IConstruct
65 66 67 |
# File 'reference.rb', line 65 def target() jsii_get_property("target") end |
#to_json ⇒ Object
Turn this Token into JSON.
Called automatically when JSON.stringify() is called on a Token.
92 93 94 |
# File 'reference.rb', line 92 def to_json() jsii_call_method("toJSON", []) end |
#to_string ⇒ String
Convert an instance of this Token to a string.
This method will be called implicitly by language runtimes if the object is embedded into a string. We treat it the same as an explicit stringification.
103 104 105 |
# File 'reference.rb', line 103 def to_string() jsii_call_method("toString", []) end |
#to_string_list ⇒ Array<String>
Convert an instance of this Token to a string list.
This method will be called implicitly by language runtimes if the object is embedded into a list. We treat it the same as an explicit stringification.
114 115 116 |
# File 'reference.rb', line 114 def to_string_list() jsii_call_method("toStringList", []) end |
#type_hint ⇒ AWSCDK::ResolutionTypeHint?
Type that the Intrinsic is expected to evaluate to.
55 56 57 |
# File 'reference.rb', line 55 def type_hint() jsii_get_property("typeHint") end |