Class: AWSCDK::Intrinsic

Inherits:
Jsii::Object
  • Object
show all
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

CfnDynamicReference, Reference, SecretValue

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, options = nil) ⇒ Intrinsic

Returns a new instance of Intrinsic.

Parameters:



16
17
18
19
20
21
# File 'intrinsic.rb', line 16

def initialize(value, options = nil)
  options = options.is_a?(Hash) ? ::AWSCDK::IntrinsicProps.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "value")
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5JbnRyaW5zaWNQcm9wcyJ9")), "options") unless options.nil?
  Jsii::Object.instance_method(:initialize).bind(self).call(value, options)
end

Class Method Details

.jsii_overridable_methodsObject



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_stackArray<String>

The captured stack trace which represents the location in which this token was created.

Returns:

  • (Array<String>)


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.

Parameters:

  • message (String)

    Error message.

Returns:

  • (Object)


53
54
55
56
# File 'intrinsic.rb', line 53

def new_error(message)
  Jsii::Type.check_type(message, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "message")
  jsii_call_method("newError", [message])
end

#resolve(_context) ⇒ Object

Produce the Token's value at resolution time.

Parameters:

Returns:

  • (Object)


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_jsonObject

Turn this Token into JSON.

Called automatically when JSON.stringify() is called on a Token.

Returns:

  • (Object)


72
73
74
# File 'intrinsic.rb', line 72

def to_json()
  jsii_call_method("toJSON", [])
end

#to_stringString

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.

Returns:

  • (String)


83
84
85
# File 'intrinsic.rb', line 83

def to_string()
  jsii_call_method("toString", [])
end

#to_string_listArray<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.

Returns:

  • (Array<String>)


94
95
96
# File 'intrinsic.rb', line 94

def to_string_list()
  jsii_call_method("toStringList", [])
end

#type_hintAWSCDK::ResolutionTypeHint?

Type that the Intrinsic is expected to evaluate to.

Returns:



45
46
47
# File 'intrinsic.rb', line 45

def type_hint()
  jsii_get_property("typeHint")
end