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


The Integer class contains the #succ method returning (self + 1). I feel that it would be good to have the symetric method #pred too.


A user knowing about Integer#succ might want to use Integer#pred.


This change should be trivial and does not present any problem with backwards compatibility.


class Integer def pred self - 1 end end

Return to top

Copyright © 2006, Ruby Power and Light, LLC