Class: TurbineRb::ProcessImpl
- Inherits:
-
Io::Meroxa::Funtime::Function::Service
- Object
- Io::Meroxa::Funtime::Function::Service
- TurbineRb::ProcessImpl
- Defined in:
- lib/turbine_rb.rb
Instance Method Summary collapse
-
#initialize(process) ⇒ ProcessImpl
constructor
A new instance of ProcessImpl.
- #process(request, _call) ⇒ Object
Constructor Details
#initialize(process) ⇒ ProcessImpl
Returns a new instance of ProcessImpl.
82 83 84 85 |
# File 'lib/turbine_rb.rb', line 82 def initialize(process) @process = process super() end |
Instance Method Details
#process(request, _call) ⇒ Object
87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/turbine_rb.rb', line 87 def process(request, _call) records = TurbineRb::Records.new(request.records) # records are processed but not in proto format processed_records = @process.call(records: records) # to proto serialized_records = processed_records.map(&:serialize) Io::Meroxa::Funtime::ProcessRecordResponse.new(records: serialized_records) end |