lib/rext/numeric/bytes.rb in visionmedia-rext-0.1.0 vs lib/rext/numeric/bytes.rb in visionmedia-rext-0.2.1
- old
+ new
@@ -1,12 +1,12 @@
class Numeric
- def bytes; self end
- def kilobytes; self * 1024 end
- def megabytes; self * 1024.kilobytes end
- def gigabytes; self * 1024.megabytes end
- def terabytes; self * 1024.gigabytes end
+ def bytes; self end
+ def kilobytes; self << 10 end
+ def megabytes; self << 20 end
+ def gigabytes; self << 30 end
+ def terabytes; self << 40 end
alias :byte :bytes
alias :kilobyte :kilobytes
alias :megabyte :megabytes
alias :gigabyte :gigabytes
\ No newline at end of file