class Patterns::GeneralPractitioner
General practitioner object - Can handle adults (or children) with a sore throat.
Public Instance Methods
description()
click to toggle source
Description of the general practitioner
# File app/models/chain_of_responsibility/general_practitioner.rb, line 18 def description 'Can handle general practice and non life threatening illnesses.' end
see_patient(patient)
click to toggle source
Sees a patient and either cures the patient or sends the patient up the chain
Calls superclass method
Patterns::Doctor#see_patient
# File app/models/chain_of_responsibility/general_practitioner.rb, line 8 def see_patient(patient) super(patient) if patient.has_illness? && patient.illness == SORE_THROAT patient.set_illness(NONE) else send_up_chain(patient) end end