Sha256: 3f769c88117fcaf0e258457db00ebf1945897e21d27be21971f52a96ac89be42

Contents?: true

Size: 220 Bytes

Versions: 8

Compression:

Stored size: 220 Bytes

Contents

module Vagabond
  class << self
    def get_bytes(s)
      s = s.to_s
      indx = [nil, 'k', 'm', 'g']
      power = indx.index(s.slice(-1, s.length).to_s.downcase).to_i * 10
      (2**power) * s.to_i
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
vagabond-0.2.8 lib/vagabond/cookbooks/vagabond/libraries/vagabond.rb
vagabond-0.2.6 lib/vagabond/cookbooks/vagabond/libraries/vagabond.rb
vagabond-0.2.4 lib/vagabond/cookbooks/vagabond/libraries/vagabond.rb
vagabond-0.2.2 lib/vagabond/cookbooks/vagabond/libraries/vagabond.rb
vagabond-0.2.0 lib/vagabond/cookbooks/vagabond/libraries/vagabond.rb
vagabond-0.1.4 lib/vagabond/cookbooks/vagabond/libraries/vagabond.rb
vagabond-0.1.2 lib/vagabond/cookbooks/vagabond/libraries/vagabond.rb
vagabond-0.1.0 lib/vagabond/cookbooks/vagabond/libraries/vagabond.rb