Froze rails gems
[depot.git] / vendor / rails / activesupport / lib / active_support / core_ext / numeric / bytes.rb
1 module ActiveSupport #:nodoc:
2 module CoreExtensions #:nodoc:
3 module Numeric #:nodoc:
4 # Enables the use of byte calculations and declarations, like 45.bytes + 2.6.megabytes
5 module Bytes
6 def bytes
7 self
8 end
9 alias :byte :bytes
10
11 def kilobytes
12 self * 1024
13 end
14 alias :kilobyte :kilobytes
15
16 def megabytes
17 self * 1024.kilobytes
18 end
19 alias :megabyte :megabytes
20
21 def gigabytes
22 self * 1024.megabytes
23 end
24 alias :gigabyte :gigabytes
25
26 def terabytes
27 self * 1024.gigabytes
28 end
29 alias :terabyte :terabytes
30
31 def petabytes
32 self * 1024.terabytes
33 end
34 alias :petabyte :petabytes
35
36 def exabytes
37 self * 1024.petabytes
38 end
39 alias :exabyte :exabytes
40
41 end
42 end
43 end
44 end