class Patterns::Surgeon

Surgeon -> Doctor

Surgeon object - can handle internal bleeding

Public Instance Methods

description() click to toggle source

Description of the suregon

# File app/models/chain_of_responsibility/surgeon.rb, line 18
def description
  'Can handle life threatening injuries.'
end
see_patient(patient) click to toggle source

Sees a patient, cures them if they have internal bleeding, sends them up the chain otherwise

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