When I tried to shorten an array, I get an error like this:
in `sort_by': undefined method `<=>' for nil:NilClass (NoMethodError)
@@secarr=@@secarr.sort_by{ |hotelname, location, cuisine, price| hotelname }
Please explain because I am a newbie to ruby.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…