aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/numeric
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-03-25 21:43:46 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-03-25 21:43:46 +0000
commit6247689e5932749514e29d3b1e1bb096ee7677d5 (patch)
treee3e4042f5910710e41a68e0c61fcffc0ebe09e41 /activesupport/lib/active_support/core_ext/numeric
parent75de3cbb13b03da8d53460de2a33135269a0a379 (diff)
downloadrails-6247689e5932749514e29d3b1e1bb096ee7677d5.tar.gz
rails-6247689e5932749514e29d3b1e1bb096ee7677d5.tar.bz2
rails-6247689e5932749514e29d3b1e1bb096ee7677d5.zip
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
Diffstat (limited to 'activesupport/lib/active_support/core_ext/numeric')
-rw-r--r--activesupport/lib/active_support/core_ext/numeric/time.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/numeric/time.rb b/activesupport/lib/active_support/core_ext/numeric/time.rb
index b4954e943f..93740046db 100644
--- a/activesupport/lib/active_support/core_ext/numeric/time.rb
+++ b/activesupport/lib/active_support/core_ext/numeric/time.rb
@@ -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