Class: Temporalio::SearchAttributes::Update

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

Overview

Search attribute update 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 instead.

Parameters:

  • key (Key)

    Key to update.

  • value (Object, nil)

    Value to update to or nil to remove the value.

Raises:

  • (ArgumentError)


100
101
102
103
104
105
106
# File 'lib/temporalio/search_attributes.rb', line 100

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

  key.validate_value(value) unless value.nil?
  @key = key
  @value = value
end

Instance Attribute Details

#keyKey (readonly)

Returns Key this update applies to.

Returns:

  • (Key)

    Key this update applies to.



91
92
93
# File 'lib/temporalio/search_attributes.rb', line 91

def key
  @key
end

#valueObject? (readonly)

Returns Value to update or ‘nil` to remove the key.

Returns:

  • (Object, nil)

    Value to update or ‘nil` to remove the key.



94
95
96
# File 'lib/temporalio/search_attributes.rb', line 94

def value
  @value
end