Add ref.; casing multiple conditions in Ruby