Class: AWSCDK::CloudFront::FunctionCode

Inherits:
Jsii::Object
  • Object
show all
Defined in:
cloud_front/function_code.rb

Overview

Represents the function's source code.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFunctionCode

Returns a new instance of FunctionCode.



8
9
10
# File 'cloud_front/function_code.rb', line 8

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

Class Method Details

.from_file(options) ⇒ AWSCDK::CloudFront::FunctionCode

Code from external file for function.

Parameters:

Returns:

  • (AWSCDK::CloudFront::FunctionCode)

    code object with contents from file.



22
23
24
25
26
# File 'cloud_front/function_code.rb', line 22

def self.from_file(options)
  options = options.is_a?(Hash) ? ::AWSCDK::CloudFront::FileCodeOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWRmcm9udC5GaWxlQ29kZU9wdGlvbnMifQ==")), "options")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_cloudfront.FunctionCode", "fromFile", [options])
end

.from_inline(code) ⇒ AWSCDK::CloudFront::FunctionCode

Inline code for function.

Parameters:

  • code (String)

    The actual function code.

Returns:

  • (AWSCDK::CloudFront::FunctionCode)

    code object with inline code.



32
33
34
35
# File 'cloud_front/function_code.rb', line 32

def self.from_inline(code)
  Jsii::Type.check_type(code, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "code")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_cloudfront.FunctionCode", "fromInline", [code])
end

.jsii_overridable_methodsObject



12
13
14
15
16
# File 'cloud_front/function_code.rb', line 12

def self.jsii_overridable_methods
  {
    :render => { kind: :method, name: "render", is_optional: false },
  }
end

Instance Method Details

#renderString

renders the function code.

Returns:

  • (String)


40
41
42
# File 'cloud_front/function_code.rb', line 40

def render()
  jsii_call_method("render", [])
end