diff options
author | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-18 13:38:55 +0000 |
---|---|---|
committer | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-18 13:38:55 +0000 |
commit | a542b9248e8cfda87a73d57cf7438c9e86d41c1f (patch) | |
tree | 0a4ab1ece5c28f9d9dec5e9023abfbc4aef5bc94 /lib/date.rb | |
parent | a07cef02a959f735538f3194a094b2346603664a (diff) | |
download | ruby-a542b9248e8cfda87a73d57cf7438c9e86d41c1f.tar.gz |
* lib/date.rb: do not require lib/delta.rb.
* lib/date/delta.rb: follows the above change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/date.rb')
-rw-r--r-- | lib/date.rb | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/date.rb b/lib/date.rb index 802ce8ec14..daa51d8e0e 100644 --- a/lib/date.rb +++ b/lib/date.rb @@ -194,7 +194,6 @@ # puts secs_to_new_year() require 'date/format' -require 'date/delta' # Class representing a date. # @@ -1337,9 +1336,6 @@ class Date def + (n) case n when Numeric; return self.class.new!(@ajd + n, @of, @sg) - when Delta - d = n.__send__(:delta) - return (self >> d.imag) + d.real end raise TypeError, 'expected numeric' end @@ -1356,11 +1352,8 @@ class Date case x when Numeric; return self.class.new!(@ajd - x, @of, @sg) when Date; return @ajd - x.ajd - when Delta - d = x.__send__(:delta) - return (self << d.imag) - d.real end - raise TypeError, 'expected numeric' + raise TypeError, 'expected numeric or date' end # Compare this date with another date. |