Class: Temporal::Metadata::Workflow

Inherits:
Base
  • Object
show all
Defined in:
lib/temporal/metadata/workflow.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#activity?, #workflow_task?

Constructor Details

#initialize(name:, run_id:, attempt:, headers: {}) ⇒ Workflow

Returns a new instance of Workflow.



8
9
10
11
12
13
14
15
# File 'lib/temporal/metadata/workflow.rb', line 8

def initialize(name:, run_id:, attempt:, headers: {})
  @name = name
  @run_id = run_id
  @attempt = attempt
  @headers = headers

  freeze
end

Instance Attribute Details

#attemptObject (readonly)

Returns the value of attribute attempt.



6
7
8
# File 'lib/temporal/metadata/workflow.rb', line 6

def attempt
  @attempt
end

#headersObject (readonly)

Returns the value of attribute headers.



6
7
8
# File 'lib/temporal/metadata/workflow.rb', line 6

def headers
  @headers
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/temporal/metadata/workflow.rb', line 6

def name
  @name
end

#run_idObject (readonly)

Returns the value of attribute run_id.



6
7
8
# File 'lib/temporal/metadata/workflow.rb', line 6

def run_id
  @run_id
end

Instance Method Details

#to_hObject



21
22
23
24
25
26
27
# File 'lib/temporal/metadata/workflow.rb', line 21

def to_h
  {
    'workflow_name' => name,
    'workflow_run_id' => run_id,
    'attempt' => attempt
  }
end

#workflow?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/temporal/metadata/workflow.rb', line 17

def workflow?
  true
end