Class: Temporalio::Client::ActivityOptions::Key

Inherits:
Object
  • Object
show all
Defined in:
lib/temporalio/client/activity_options.rb

Overview

Typed key for one updatable activity option. Use the keys on Temporalio::Client::ActivityOptions rather than constructing these directly.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameString (readonly)

Returns Field-mask path this key updates.

Returns:

  • (String)

    Field-mask path this key updates.



19
20
21
# File 'lib/temporalio/client/activity_options.rb', line 19

def name
  @name
end

Instance Method Details

#value_set(value) ⇒ Update

Create an update that sets this option to the given value.

Parameters:

  • value (Object)

    Value to set. Cannot be nil.

Returns:

  • (Update)

    Created update.

Raises:

  • (ArgumentError)


32
33
34
35
36
# File 'lib/temporalio/client/activity_options.rb', line 32

def value_set(value)
  raise ArgumentError, 'Value cannot be nil, use value_unset' if value.nil?

  Update.new(self, value)
end

#value_unsetUpdate

Create an update that clears this option server-side.

Returns:

  • (Update)

    Created update.



41
42
43
# File 'lib/temporalio/client/activity_options.rb', line 41

def value_unset
  Update.new(self, nil)
end