Sha256: b4ebcde49f66e0acb56e7c92ba04bc3005dc5bb9ec05867846971e9626af27a8

Contents?: true

Size: 721 Bytes

Versions: 158

Compression:

Stored size: 721 Bytes

Contents

# frozen_string_literal: true

require "renalware"
require "renalware/accesses"

module Renalware
  module Accesses
    class PatientPresenter < SimpleDelegator
      # delegate_missing_to :patient # TODO: when rails 5.1, try instead of SimpleDelegator
      delegate :plan_type, :created_at, to: :access_plan, prefix: true
      delegate :type, :started_on, to: :access_profile, prefix: true

      def initialize(patient)
        super(Accesses.cast_patient(patient.__getobj__))
      end

      private

      def access_plan
        @access_plan ||= current_plan || NullObject.instance
      end

      def access_profile
        @access_profile ||= current_profile || NullObject.instance
      end
    end
  end
end

Version data entries

158 entries across 158 versions & 1 rubygems

Version Path
renalware-core-2.0.84 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.83 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.82 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.81 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.80 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.79 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.78 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.77 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.76 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.75 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.74 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.73 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.72 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.71 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.70 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.69 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.68 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.67 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.64 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.63 app/presenters/renalware/accesses/patient_presenter.rb