diff options
Diffstat (limited to 'ext/date/lib/date.rb')
| -rw-r--r-- | ext/date/lib/date.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/date/lib/date.rb b/ext/date/lib/date.rb index b72b4157f2..0cb763017f 100644 --- a/ext/date/lib/date.rb +++ b/ext/date/lib/date.rb @@ -4,15 +4,18 @@ require 'date_core' class Date + VERSION = "3.5.1" # :nodoc: + # call-seq: + # infinite? -> false + # + # Returns +false+ def infinite? false end class Infinity < Numeric # :nodoc: - include Comparable - def initialize(d=1) @d = d <=> 0 end def d() @d end @@ -32,6 +35,8 @@ class Date def <=>(other) case other when Infinity; return d <=> other.d + when Float::INFINITY; return d <=> 1 + when -Float::INFINITY; return d <=> -1 when Numeric; return d else begin |
