Class: DurableFlow::WorkflowTimeline::Item

Inherits:
Struct
  • Object
show all
Defined in:
lib/durable_flow/workflow_timeline.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#recordObject

Returns the value of attribute record

Returns:

  • (Object)

    the current value of record



12
13
14
# File 'lib/durable_flow/workflow_timeline.rb', line 12

def record
  @record
end

#stepObject

Returns the value of attribute step

Returns:

  • (Object)

    the current value of step



12
13
14
# File 'lib/durable_flow/workflow_timeline.rb', line 12

def step
  @step
end

#step_idObject

Returns the value of attribute step_id

Returns:

  • (Object)

    the current value of step_id



12
13
14
# File 'lib/durable_flow/workflow_timeline.rb', line 12

def step_id
  @step_id
end

#timestampObject

Returns the value of attribute timestamp

Returns:

  • (Object)

    the current value of timestamp



12
13
14
# File 'lib/durable_flow/workflow_timeline.rb', line 12

def timestamp
  @timestamp
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



12
13
14
# File 'lib/durable_flow/workflow_timeline.rb', line 12

def type
  @type
end

Instance Method Details

#idObject



13
14
15
# File 'lib/durable_flow/workflow_timeline.rb', line 13

def id
  "#{type}-#{record.id}"
end

#nameObject



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/durable_flow/workflow_timeline.rb', line 17

def name
  case type
  when :step
    record.name
  when :wait
    record.event_name
  when :event
    record.name
  when :log
    record.message
  end
end

#run_level?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/durable_flow/workflow_timeline.rb', line 34

def run_level?
  step_id.nil?
end

#statusObject



30
31
32
# File 'lib/durable_flow/workflow_timeline.rb', line 30

def status
  record.status if record.respond_to?(:status)
end