Sha256: ab791cb30b26efd0faa142dee35992507624eae3bef8476e281dddac5e59a151

Contents?: true

Size: 258 Bytes

Versions: 1

Compression:

Stored size: 258 Bytes

Contents

module Humanize
  class Byte < Bytes
    def to_b
      self
    end

    def to_k
      Kilo.new @value / 1024.0
    end

    def to_m
      Mega.new @value / 1024.0 / 1024
    end

    def to_g
      Giga.new @value / 1024.0 / 1024 / 1024
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
humanize-bytes-2.1.0 lib/humanize/byte.rb