Sha256: 15771e9450e4372c962fc5a4edf234215d3a8f9f7fcdb1427adeeda2c6d9f51c

Contents?: true

Size: 928 Bytes

Versions: 145

Compression:

Stored size: 928 Bytes

Contents

module ActiveSupport #:nodoc:
  module CoreExtensions #:nodoc:
    module Numeric #:nodoc:
      # Enables the use of byte calculations and declarations, like 45.bytes + 2.6.megabytes
      module Bytes
        def bytes
          self
        end
        alias :byte :bytes

        def kilobytes
          self * 1024
        end
        alias :kilobyte :kilobytes

        def megabytes
          self * 1024.kilobytes
        end
        alias :megabyte :megabytes

        def gigabytes
          self * 1024.megabytes 
        end
        alias :gigabyte :gigabytes

        def terabytes
          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
end

Version data entries

145 entries across 144 versions & 20 rubygems

Version Path
radiant-0.7.2 vendor/rails/activesupport/lib/active_support/core_ext/numeric/bytes.rb
vibes-bj-1.2.2 spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/numeric/bytes.rb
vibes-bj-1.2.1 spec/rails_root/vendor/rails/activesupport/lib/active_support/core_ext/numeric/bytes.rb
nbudin-castronaut-0.7.5 vendor/activesupport/lib/active_support/core_ext/numeric/bytes.rb
usher-0.7.0 spec/rails2_2/vendor/rails/vendor/rails/activesupport/lib/active_support/core_ext/numeric/bytes.rb
usher-0.7.0 spec/rails2_2/vendor/rails/vendor/rails/activesupport/pkg/activesupport-2.2.2/lib/active_support/core_ext/numeric/bytes.rb
factorylabs-castronaut-0.7.5 vendor/activesupport/lib/active_support/core_ext/numeric/bytes.rb
jstorimer-deep-test-2.0.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/numeric/bytes.rb
jstorimer-deep-test-1.4.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/numeric/bytes.rb
jstorimer-deep-test-1.3.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/numeric/bytes.rb
jstorimer-deep-test-1.2.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/numeric/bytes.rb
jstorimer-deep-test-1.1.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/numeric/bytes.rb
jstorimer-deep-test-1.0.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/numeric/bytes.rb
jstorimer-deep-test-0.2.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/numeric/bytes.rb
jstorimer-deep-test-0.1.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/numeric/bytes.rb
activesupport-2.2.3 lib/active_support/core_ext/numeric/bytes.rb
webroar-0.2.2 src/admin_panel/vendor/rails/activesupport/lib/active_support/core_ext/numeric/bytes.rb
activesupport-1.4.3 lib/active_support/core_ext/numeric/bytes.rb
activesupport-2.0.1 lib/active_support/core_ext/numeric/bytes.rb
activesupport-1.2.4 lib/active_support/core_ext/numeric/bytes.rb