Permalink
Browse files

Added Fixnum#seconds for consistency, so you can say 5.minutes + 30.s…

…econds instead of 5.minutes + 30 (closes #4389) [Francois Beausoleil]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4029 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 75de3cb commit 6247689e5932749514e29d3b1e1bb096ee7677d5 @dhh dhh committed Mar 25, 2006
Showing with 7 additions and 0 deletions.
  1. +2 −0 activesupport/CHANGELOG
  2. +5 −0 activesupport/lib/active_support/core_ext/numeric/time.rb
@@ -1,5 +1,7 @@
*SVN*
+* Added Fixnum#seconds for consistency, so you can say 5.minutes + 30.seconds instead of 5.minutes + 30 #4389 [François Beausoleil]
+
* Added option to String#camelize to generate lower-cased camel case by passing in :lower, like "super_man".camelize(:lower) # => "superMan" [DHH]
* Added Hash#diff to show the difference between two hashes [Chris McGrath]
@@ -11,6 +11,11 @@ module Numeric #:nodoc:
# Time[http://stdlib.rubyonrails.org/libdoc/time/rdoc/index.html] should be used for precision
# date and time arithmetic
module Time
+ def seconds
+ self
+ end
+ alias :second :seconds
+
def minutes
self * 60
end

0 comments on commit 6247689

Please sign in to comment.