Class: Temporalio::Client::ActivityOptions::Update

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

Overview

A single change to an activity's options that can be separately applied.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, value) ⇒ Update

Create an update. Users may find it easier to use Key#value_set and Key#value_unset.

Parameters:

  • key (Key)

    Key to update.

  • value (Object, nil)

    Value to set, or nil to clear the option.

Raises:

  • (ArgumentError)


63
64
65
66
67
68
69
# File 'lib/temporalio/client/activity_options.rb', line 63

def initialize(key, value)
  raise ArgumentError, 'Key must be a key' unless key.is_a?(Key)

  @key = key
  @value = value
  freeze
end

Instance Attribute Details

#keyKey (readonly)

Returns Key this update applies to.

Returns:

  • (Key)

    Key this update applies to.



54
55
56
# File 'lib/temporalio/client/activity_options.rb', line 54

def key
  @key
end

#valueObject? (readonly)

Returns Value to set, or nil to clear the option.

Returns:

  • (Object, nil)

    Value to set, or nil to clear the option.



57
58
59
# File 'lib/temporalio/client/activity_options.rb', line 57

def value
  @value
end