Class: Actions::Helpers::Presenter::Delegated

Inherits:
Base
  • Object
show all
Defined in:
app/lib/actions/helpers/presenter.rb

Overview

Use sub-actions for presenting the data of the task

Instance Attribute Summary

Attributes inherited from Base

#action

Instance Method Summary collapse

Constructor Details

#initialize(_action, delegated_actions) ⇒ Delegated

Returns a new instance of Delegated.



27
28
29
30
# File 'app/lib/actions/helpers/presenter.rb', line 27

def initialize(_action, delegated_actions)
  (Type! delegated_actions, Array).all? { |a| Type! a, Presenter }
  @delegated_actions = delegated_actions
end

Instance Method Details

#humanized_outputObject



32
33
34
# File 'app/lib/actions/helpers/presenter.rb', line 32

def humanized_output
  @delegated_actions.map(&:humanized_output).compact.join("\n")
end