aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/numeric
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-10-26 13:10:03 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-10-26 13:10:03 +0000
commit0d52abfd0ea42ba8f9bac996378087be42b93917 (patch)
tree645aaace243f83b00c0bc679534113d68126e273 /activesupport/lib/active_support/core_ext/numeric
parentfabf34848eda7656f7a7f79647167e0fdd16f682 (diff)
downloadrails-0d52abfd0ea42ba8f9bac996378087be42b93917.tar.gz
rails-0d52abfd0ea42ba8f9bac996378087be42b93917.tar.bz2
rails-0d52abfd0ea42ba8f9bac996378087be42b93917.zip
Added petabytes and exebytes to numeric extensions (closes #2397) [timct@mac.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2746 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/bytes.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/numeric/bytes.rb b/activesupport/lib/active_support/core_ext/numeric/bytes.rb
index 98e5e13abb..56477673a3 100644
--- a/activesupport/lib/active_support/core_ext/numeric/bytes.rb
+++ b/activesupport/lib/active_support/core_ext/numeric/bytes.rb
@@ -27,6 +27,17 @@ module ActiveSupport #:nodoc:
self * 1024.gigabytes
end
alias :terabyte :terabytes
+
+ def petabytes
+ self * 1024.terabytes
+ end
+ alias :petabyte :petabytes
+
+ def exabytes
+ self * 1024.petabytes
+ end
+ alias :exabyte :exabytes
+
end
end
end