mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/date/lib/date.rb: fix indent [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7ce520e90a
commit
2f00c56eb7
1 changed files with 8 additions and 8 deletions
|
@ -29,11 +29,11 @@ class Date
|
||||||
when Infinity; return d <=> other.d
|
when Infinity; return d <=> other.d
|
||||||
when Numeric; return d
|
when Numeric; return d
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
l, r = other.coerce(self)
|
l, r = other.coerce(self)
|
||||||
return l <=> r
|
return l <=> r
|
||||||
rescue NoMethodError
|
rescue NoMethodError
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
@ -42,16 +42,16 @@ class Date
|
||||||
case other
|
case other
|
||||||
when Numeric; return -d, d
|
when Numeric; return -d, d
|
||||||
else
|
else
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_f
|
def to_f
|
||||||
return 0 if @d == 0
|
return 0 if @d == 0
|
||||||
if @d > 0
|
if @d > 0
|
||||||
Float::INFINITY
|
Float::INFINITY
|
||||||
else
|
else
|
||||||
-Float::INFINITY
|
-Float::INFINITY
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue