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.
112 113 114 |
# File 'lib/functions_framework/function.rb', line 112 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:httpor:cloud_event.
126 127 128 |
# File 'lib/functions_framework/function.rb', line 126 def context @context end |