Class: Temporalio::Converters::PayloadConverter::Encoding
- Inherits:
-
Object
- Object
- Temporalio::Converters::PayloadConverter::Encoding
- Defined in:
- lib/temporalio/converters/payload_converter/encoding.rb
Overview
Direct Known Subclasses
BinaryNull, BinaryPlain, BinaryProtobuf, JSONPlain, JSONProtobuf
Instance Method Summary collapse
-
#encoding ⇒ String
Encoding that will be put on the payload metadata if this encoding converter can handle the value.
-
#from_payload(payload, hint: nil) ⇒ Object
Convert the payload to a Ruby value.
-
#to_payload(value, hint: nil) ⇒ Api::Common::V1::Payload?
Convert value to payload if this encoding converter can handle it, or return
nil.
Instance Method Details
#encoding ⇒ String
Returns Encoding that will be put on the payload metadata if this encoding converter can handle the value.
11 12 13 |
# File 'lib/temporalio/converters/payload_converter/encoding.rb', line 11 def encoding raise NotImplementedError end |
#from_payload(payload, hint: nil) ⇒ Object
Convert the payload to a Ruby value. The caller confirms the encoding metadata matches #encoding, so this will error if it cannot convert.
31 32 33 |
# File 'lib/temporalio/converters/payload_converter/encoding.rb', line 31 def from_payload(payload, hint: nil) raise NotImplementedError end |
#to_payload(value, hint: nil) ⇒ Api::Common::V1::Payload?
Convert value to payload if this encoding converter can handle it, or return nil. If the converter can handle it, the resulting payload must have encoding metadata on the payload set to the value of #encoding.
21 22 23 |
# File 'lib/temporalio/converters/payload_converter/encoding.rb', line 21 def to_payload(value, hint: nil) raise NotImplementedError end |