Sha256: a4b3facec88859cdda7b6ac334107f7502825d892b515e13ae45e3a6f76493fd

Contents?: true

Size: 200 Bytes

Versions: 4

Compression:

Stored size: 200 Bytes

Contents

class Fixnum
  def to_human_size
    case self
      when 1024..1048576 then "#{self / 1024} kb"
      when 1048576..1073741824 then "#{self / 1048576} mb"
      else "#{self} bytes"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
httping-1.3.0 lib/extensions/fixnum.rb
httping-1.1.0 lib/extensions/fixnum.rb
httping-1.0.1 lib/extensions/fixnum.rb
httping-1.0.0 lib/extensions/fixnum.rb