Class: WorkflowTemplate::Action::Description::Wrapper

Inherits:
Validated
  • Object
show all
Defined in:
lib/workflow_template/action/description/wrapper.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action, nested_actions) ⇒ Wrapper

Returns a new instance of Wrapper.



17
18
19
20
# File 'lib/workflow_template/action/description/wrapper.rb', line 17

def initialize(action, nested_actions)
  @nested_actions = nested_actions.freeze
  super(action)
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



15
16
17
# File 'lib/workflow_template/action/description/wrapper.rb', line 15

def action
  @action
end

#nested_actionsObject (readonly)

Returns the value of attribute nested_actions.



15
16
17
# File 'lib/workflow_template/action/description/wrapper.rb', line 15

def nested_actions
  @nested_actions
end

Class Method Details

.instance(action, nested_actions) ⇒ Object



9
10
11
# File 'lib/workflow_template/action/description/wrapper.rb', line 9

def self.instance(action, nested_actions)
  new action, nested_actions
end

Instance Method Details

#format(level:) ⇒ Object



22
23
24
# File 'lib/workflow_template/action/description/wrapper.rb', line 22

def format(level:)
  super + nested_actions.flat_map { |nested_action| nested_action.format(level: level + 1) }
end