Sha256: 79e4fcc4822f1edc3dd4e37b4de4387b6727e7eae831888f5f2b1b2965817ff4

Contents?: true

Size: 240 Bytes

Versions: 1

Compression:

Stored size: 240 Bytes

Contents

module Humanize
  class Mega < Bytes
    def to_b
      Byte.new @value * 1024 * 1024
    end

    def to_k
      Kilo.new @value * 1024
    end

    def to_m
      self
    end

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

Version data entries

1 entries across 1 versions & 1 rubygems

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