Class: Temporal::Client::Converter::Base
- Inherits:
-
Object
- Object
- Temporal::Client::Converter::Base
- Defined in:
- lib/temporal/client/converter/base.rb
Direct Known Subclasses
Instance Method Summary collapse
- #from_payload(payload) ⇒ Object
- #from_payloads(payloads) ⇒ Object
-
#initialize(payload_converter:) ⇒ Base
constructor
A new instance of Base.
- #to_payload(data) ⇒ Object
- #to_payloads(data) ⇒ Object
Constructor Details
#initialize(payload_converter:) ⇒ Base
Returns a new instance of Base.
5 6 7 |
# File 'lib/temporal/client/converter/base.rb', line 5 def initialize(payload_converter:) @payload_converter = payload_converter end |
Instance Method Details
#from_payload(payload) ⇒ Object
14 15 16 |
# File 'lib/temporal/client/converter/base.rb', line 14 def from_payload(payload) payload_converter.from_payload(payload) end |
#from_payloads(payloads) ⇒ Object
9 10 11 12 |
# File 'lib/temporal/client/converter/base.rb', line 9 def from_payloads(payloads) return nil if payloads.nil? payloads.payloads.map(&method(:from_payload)) end |
#to_payload(data) ⇒ Object
25 26 27 |
# File 'lib/temporal/client/converter/base.rb', line 25 def to_payload(data) payload_converter.to_payload(data) end |