summaryrefslogtreecommitdiff
path: root/lib/date2.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-07-10 04:49:24 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-07-10 04:49:24 +0000
commitc67a74570dd056569763f5015e0aafa7d454fca7 (patch)
treef1dda39296b6911752cd4b6446a21f2e54ff68e1 /lib/date2.rb
parent3043170b14875ce53f3a951d665279b12c2c63a8 (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/date2.rb')
-rw-r--r--lib/date2.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/date2.rb b/lib/date2.rb
index e1badcd..ad63145 100644
--- a/lib/date2.rb
+++ b/lib/date2.rb
@@ -147,7 +147,7 @@ class Date
def new3(y=-4712, m=1, d=1, sg=ITALY)
unless jd = exist3?(y, m, d, sg)
- fail ArgumentError, 'invalid date'
+ raise ArgumentError, 'invalid date'
end
new(jd, sg)
end
@@ -169,7 +169,7 @@ class Date
def new2(y=-4712, d=1, sg=ITALY)
unless jd = exist2?(y, d, sg)
- fail ArgumentError, 'invalid date'
+ raise ArgumentError, 'invalid date'
end
new(jd, sg)
end
@@ -189,7 +189,7 @@ class Date
def neww(y=1582, w=41, d=5, sg=ITALY)
unless jd = existw?(y, w, d, sg)
- fail ArgumentError, 'invalid date'
+ raise ArgumentError, 'invalid date'
end
new(jd, sg)
end
@@ -280,7 +280,7 @@ class Date
case n
when Numeric; return type.new(@rjd + n, @sg)
end
- fail TypeError, 'expected numeric'
+ raise TypeError, 'expected numeric'
end
def - (x)
@@ -288,7 +288,7 @@ class Date
when Numeric; return type.new(@rjd - x, @sg)
when Date; return @rjd - x.rjd
end
- fail TypeError, 'expected numeric or date'
+ raise TypeError, 'expected numeric or date'
end
def <=> (other)
@@ -296,7 +296,7 @@ class Date
when Numeric; return @rjd <=> other
when Date; return @rjd <=> other.rjd
end
- fail TypeError, 'expected numeric or date'
+ raise TypeError, 'expected numeric or date'
end
def === (other)
@@ -304,7 +304,7 @@ class Date
when Numeric; return jd == other
when Date; return jd == other.jd
end
- fail TypeError, 'expected numeric or date'
+ raise TypeError, 'expected numeric or date'
end
def >> (n)