Sha256: 170f1b1a9af3ae53812cf558f800fc4ca9319ab714f4229a33a3c0d80a99fa79
Contents?: true
Size: 447 Bytes
Versions: 20
Compression:
Stored size: 447 Bytes
Contents
class Range def self.at_least(minimum_value) Range.new(minimum_value, infinite) end def self.at_most(maximum_value) Range.new(-infinite, maximum_value, false) end def self.infinite 1/0.0 end alias_method :__to_s__, :to_s def to_s if first.to_f.infinite? then return "at most #{last}" elsif last.to_f.infinite? then return "at least #{first}" else __to_s__ end end end
Version data entries
20 entries across 20 versions & 4 rubygems