Class: WorkflowTemplate::Action::Description::Wrapper
- Defined in:
- lib/workflow_template/action/description/wrapper.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#nested_actions ⇒ Object
readonly
Returns the value of attribute nested_actions.
Class Method Summary collapse
Instance Method Summary collapse
- #format(level:) ⇒ Object
-
#initialize(action, nested_actions) ⇒ Wrapper
constructor
A new instance of Wrapper.
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
#action ⇒ Object (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_actions ⇒ Object (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 |