Sha256: 259855ea2f77daa2496c474b33c6ca564dabf39a4d1a093fdf1abf7f7324ce16
Contents?: true
Size: 539 Bytes
Versions: 15
Compression:
Stored size: 539 Bytes
Contents
module Comparable # Returns the lower of self or x. # # 4.at_least(5) #=> 5 # 6.at_least(5) #=> 6 # # CREDIT: Florian Gross def at_least(lower) (self >= lower) ? self : lower end # Returns the greater of self or x. # # 4.at_most(5) #=> 4 # 6.at_most(5) #=> 5 # # CREDIT: Florian Gross def at_most(upper) (self <= upper) ? self : upper end # Returns the greater of self or x. # # 4.cap(5) #=> 4 # 6.cap(5) #=> 5 # # CREDIT: Trans alias_method :cap, :at_most end
Version data entries
15 entries across 15 versions & 1 rubygems