Class: Temporalio::PayloadConverter::Base Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/temporalio/payload_converter/base.rb

Overview

This class is abstract.

Use this Interface for implementing your payload converter.

Direct Known Subclasses

Composite

Instance Method Summary collapse

Instance Method Details

#from_payload(_payload) ⇒ any

Convert a proto Payload to a Ruby value.

Parameters:

Returns:

  • (any)

Raises:

  • (NoMethodError)


19
20
21
# File 'lib/temporalio/payload_converter/base.rb', line 19

def from_payload(_payload)
  raise NoMethodError, 'must implement #from_payload'
end

#to_payload(_data) ⇒ Temporalio::Api::Common::V1::Payload

Convert a Ruby value to a proto Payload.

Parameters:

  • _data (any)

    Ruby value to be converted.

Returns:

Raises:

  • (NoMethodError)


10
11
12
# File 'lib/temporalio/payload_converter/base.rb', line 10

def to_payload(_data)
  raise NoMethodError, 'must implement #to_payload'
end