diff options
author | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-26 11:14:40 +0000 |
---|---|---|
committer | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-26 11:14:40 +0000 |
commit | a90469602c82fe0fe607cc6f1c8f32b223db0394 (patch) | |
tree | f5e22a99f831016f4ea73911184a4dd57940978a /lib/date.rb | |
parent | 76b33197e245c5ad070a3da427f096a82fccf898 (diff) | |
download | ruby-a90469602c82fe0fe607cc6f1c8f32b223db0394.tar.gz |
* complex.c, rational.c, lib/cmath.rb, lib/date.rb lib/date/delta*:
reverted r27484-27486. now official spec.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/date.rb')
-rw-r--r-- | lib/date.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/date.rb b/lib/date.rb index a400c2afdc..3bb0875023 100644 --- a/lib/date.rb +++ b/lib/date.rb @@ -1371,6 +1371,12 @@ class Date case other when Numeric; return @ajd <=> other when Date; return @ajd <=> other.ajd + else + begin + l, r = other.coerce(self) + return l <=> r + rescue NoMethodError + end end nil end @@ -1385,6 +1391,9 @@ class Date case other when Numeric; return jd == other when Date; return jd == other.jd + else + l, r = other.coerce(self) + return l === r end false end |