class Temporal::Workflow::History::EventTarget

Constants

ACTIVITY_TYPE
CANCEL_ACTIVITY_REQUEST_TYPE
CANCEL_EXTERNAL_WORKFLOW_REQUEST_TYPE
CANCEL_TIMER_REQUEST_TYPE
CANCEL_WORKFLOW_REQUEST_TYPE
CHILD_WORKFLOW_TYPE
EXTERNAL_WORKFLOW_TYPE
MARKER_TYPE
TARGET_TYPES
TIMER_TYPE
WORKFLOW_TYPE

Attributes

id[R]
type[R]

Public Class Methods

from_event(event) click to toggle source
# File lib/temporal/workflow/history/event_target.rb, line 44
def self.from_event(event)
  _, target_type = TARGET_TYPES.find { |type, _| event.type.start_with?(type) }

  unless target_type
    raise UnexpectedEventType, "Unexpected event #{event.type}"
  end

  new(event.originating_event_id, target_type)
end
new(id, type) click to toggle source
# File lib/temporal/workflow/history/event_target.rb, line 54
def initialize(id, type)
  @id = id
  @type = type

  freeze
end
workflow() click to toggle source
# File lib/temporal/workflow/history/event_target.rb, line 40
def self.workflow
  @workflow ||= new(1, WORKFLOW_TYPE)
end

Public Instance Methods

==(other) click to toggle source
# File lib/temporal/workflow/history/event_target.rb, line 61
def ==(other)
  id == other.id && type == other.type
end
eql?(other) click to toggle source
# File lib/temporal/workflow/history/event_target.rb, line 65
def eql?(other)
  self == other
end
hash() click to toggle source
# File lib/temporal/workflow/history/event_target.rb, line 69
def hash
  [id, type].hash
end
to_s() click to toggle source
# File lib/temporal/workflow/history/event_target.rb, line 73
def to_s
  "#{type} (#{id})"
end