Class: Renalware::Renal::ClinicalSummaryPresenter

Inherits:
Object
  • Object
show all
Defined in:
app/presenters/renalware/renal/clinical_summary_presenter.rb

Instance Method Summary collapse

Instance Method Details

#summary_parts(current_user) ⇒ Object

Host application may override the order or add other summary presenters



12
13
14
15
16
17
18
19
20
21
22
# File 'app/presenters/renalware/renal/clinical_summary_presenter.rb', line 12

def summary_parts(current_user)
  part_class_names = Renalware.config.page_layouts[:clinical_summary]
  part_class_names.each_with_object([]) do |class_name, arr|
    klass = class_name.constantize
    arr << if class_name.end_with?("Component")
             klass.new(patient: patient, current_user: current_user)
           else
             klass.new(patient, current_user)
           end
  end.select(&:render?)
end