class Patterns::Oncologist

Oncologist -> Doctor

Public Instance Methods

description() click to toggle source

Description of the oncologist

# File app/models/chain_of_responsibility/oncologist.rb, line 16
def description
  'Can handle all types of cancer.'
end
see_patient(patient) click to toggle source

Sees a patient, if they have cancer the patient is cured, otherwise they are sent up the chain

Calls superclass method Patterns::Doctor#see_patient
# File app/models/chain_of_responsibility/oncologist.rb, line 6
def see_patient(patient)
  super(patient)
  if patient.has_illness? && patient.illness == CANCER
      patient.set_illness(NONE)
  else
    send_up_chain(patient)
  end
end