Class: FunctionsFramework::Function::CallBase
- Inherits:
-
Object
- Object
- FunctionsFramework::Function::CallBase
- Defined in:
- lib/functions_framework/function.rb
Overview
A base class for a callable object that provides calling context.
An object of this class is self
while a function block is running.
Instance Attribute Summary collapse
-
#context ⇒ Hash
readonly
A keyed hash of context information.
Instance Method Summary collapse
-
#initialize(**context) ⇒ CallBase
constructor
Create a callable object with the given context.
Constructor Details
#initialize(**context) ⇒ CallBase
Create a callable object with the given context.
113 114 115 |
# File 'lib/functions_framework/function.rb', line 113 def initialize **context @context = context end |
Instance Attribute Details
#context ⇒ Hash (readonly)
A keyed hash of context information. Common context keys include:
- :logger (
Logger
) A logger for use by this function call. - :function_name (
String
) The name of the running function. - :function_type (
Symbol
) The type of the running function, either:http
or:cloud_event
.
127 128 129 |
# File 'lib/functions_framework/function.rb', line 127 def context @context end |