Sha256: 4450962b697d02fd4d4502a55f3904ac0c58fb23e96615fad3574d82e9e3ee15

Contents?: true

Size: 690 Bytes

Versions: 19

Compression:

Stored size: 690 Bytes

Contents

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

19 entries across 19 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.rc11 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.0.pre.rc10 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.0.pre.rc9 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.0.pre.rc8 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.0.pre.rc7 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.0.pre.rc6 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.0.pre.rc5 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.0.pre.rc4 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.0.pre.rc3 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.0.pre.rc1 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.0.pre.beta12 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.0.pre.beta11 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.0.pre.beta10 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.0.pre.beta9 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.0.pre.beta8 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.0.pre.beta7 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.0.pre.beta6 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.0.pre.beta5 app/presenters/renalware/accesses/patient_presenter.rb
renalware-core-2.0.0.pre.beta4 app/presenters/renalware/accesses/patient_presenter.rb