add Integer#pred (RCR 5)
Submitted by: Robert Dober
This is the revision of Fri Jan 12 12:59:05 EST 2007
See also the current version
ABSTRACTThe Integer class contains the #succ method returning (self + 1). I feel that it would be good to have the symetric method #pred too.
PROBLEMA user knowing about Integer#succ might want to use Integer#pred.
ANALYSISThis change should be trivial and does not present any problem with backwards compatibility.
IMPLEMENTATIONclass Integer def pred self - 1 end end
Return to top
Copyright © 2006, Ruby Power and Light, LLC