class Patterns::Patient
Attributes
age[RW]
The age of the patient
illness[RW]
The illness the patient has
Public Class Methods
new(age, illness = nil)
click to toggle source
Initializes the patient class with an age and an illness/no illness
# File app/models/chain_of_responsibility/patient.rb, line 10 def initialize(age, illness = nil) @age = age @illness = illness end
Public Instance Methods
has_illness?()
click to toggle source
Returns false if patient illness is NONE or nil, true otherwise
# File app/models/chain_of_responsibility/patient.rb, line 21 def has_illness? if @illness == NONE || @illness == nil false else true end end
set_illness(illness)
click to toggle source
Sets the patient's illness
# File app/models/chain_of_responsibility/patient.rb, line 16 def set_illness(illness) @illness = illness end