Class: AWSCDK::Intrinsic
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::Intrinsic
- Includes:
- IResolvable
- Defined in:
- intrinsic.rb
Overview
Token subclass that represents values intrinsic to the target document language.
WARNING: this class should not be externally exposed, but is currently visible because of a limitation of jsii (https://github.com/aws/jsii/issues/524).
This class will disappear in a future release and should not be used.
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
-
#creation_stack ⇒ Array<String>
The captured stack trace which represents the location in which this token was created.
-
#initialize(value, options = nil) ⇒ Intrinsic
constructor
A new instance of Intrinsic.
-
#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.
-
#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, options = nil) ⇒ Intrinsic
Returns a new instance of Intrinsic.
16 17 18 19 20 21 |
# File 'intrinsic.rb', line 16 def initialize(value, = nil) = .is_a?(Hash) ? ::AWSCDK::IntrinsicProps.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "value") Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5JbnRyaW5zaWNQcm9wcyJ9")), "options") unless .nil? Jsii::Object.instance_method(:initialize).bind(self).call(value, ) end |
Class Method Details
.jsii_overridable_methods ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'intrinsic.rb', line 23 def self.jsii_overridable_methods { :creation_stack => { kind: :property, name: "creationStack", is_optional: false }, :type_hint => { kind: :property, name: "typeHint", is_optional: true }, :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.
38 39 40 |
# File 'intrinsic.rb', line 38 def creation_stack() jsii_get_property("creationStack") end |
#new_error(message) ⇒ Object
Creates a throwable Error object that contains the token creation stack trace.
53 54 55 56 |
# File 'intrinsic.rb', line 53 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.
62 63 64 65 |
# File 'intrinsic.rb', line 62 def resolve(_context) Jsii::Type.check_type(_context, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5JUmVzb2x2ZUNvbnRleHQifQ==")), "_context") jsii_call_method("resolve", [_context]) end |
#to_json ⇒ Object
Turn this Token into JSON.
Called automatically when JSON.stringify() is called on a Token.
72 73 74 |
# File 'intrinsic.rb', line 72 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.
83 84 85 |
# File 'intrinsic.rb', line 83 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.
94 95 96 |
# File 'intrinsic.rb', line 94 def to_string_list() jsii_call_method("toStringList", []) end |
#type_hint ⇒ AWSCDK::ResolutionTypeHint?
Type that the Intrinsic is expected to evaluate to.
45 46 47 |
# File 'intrinsic.rb', line 45 def type_hint() jsii_get_property("typeHint") end |