Class: SidekiqWorkflows::RootNode

Inherits:
Object
  • Object
show all
Includes:
Node
Defined in:
lib/sidekiq_workflows/root_node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Node

#add_group, #all_nodes, #serialize

Constructor Details

#initialize(workflow_uuid: nil, on_partial_complete: nil) ⇒ RootNode

Returns a new instance of RootNode.



10
11
12
13
14
# File 'lib/sidekiq_workflows/root_node.rb', line 10

def initialize(workflow_uuid: nil, on_partial_complete: nil)
  @workflow_uuid = workflow_uuid
  @on_partial_complete = on_partial_complete
  @children = []
end

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



8
9
10
# File 'lib/sidekiq_workflows/root_node.rb', line 8

def children
  @children
end

#on_partial_completeObject

Returns the value of attribute on_partial_complete.



7
8
9
# File 'lib/sidekiq_workflows/root_node.rb', line 7

def on_partial_complete
  @on_partial_complete
end

#workflow_uuidObject

Returns the value of attribute workflow_uuid.



7
8
9
# File 'lib/sidekiq_workflows/root_node.rb', line 7

def workflow_uuid
  @workflow_uuid
end

Instance Method Details

#to_hObject



16
17
18
19
20
21
22
# File 'lib/sidekiq_workflows/root_node.rb', line 16

def to_h
  {
    workflow_uuid: workflow_uuid,
    on_partial_complete: on_partial_complete,
    children: @children.map(&:to_h)
  }
end