Class: Renalware::Medications::TabbedPrescriptionsListComponent::PrescriptionGroup

Inherits:
Object
  • Object
show all
Defined in:
app/components/renalware/medications/tabbed_prescriptions_list_component.rb

Instance Method Summary collapse

Instance Method Details

#prescriptionsObject

The markup expects each prescription to have been decorated with a PresriptionPresenter. However there may be cases where they might have been, so we check by (looking for a method which is defined by the presenter) and decorate them if necessary.



32
33
34
35
36
# File 'app/components/renalware/medications/tabbed_prescriptions_list_component.rb', line 32

def prescriptions
  @prescriptions.map do |presc|
    presc.respond_to?(:drug_type_names) ? presc : PrescriptionPresenter.new(presc)
  end
end