1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Added Fixnum#seconds for consistency, so you can say 5.minutes + 30.seconds 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
This commit is contained in:
David Heinemeier Hansson 2006-03-25 21:43:46 +00:00
parent 75de3cbb13
commit 6247689e59
2 changed files with 7 additions and 0 deletions

View file

@ -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]

View file

@ -11,6 +11,11 @@ module ActiveSupport #: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