class ByteNumber
Public Class Methods
Source
# File lib/vagrant-libvirt/util/byte_number.rb, line 62 def self.from_GB(value) self.new(value*(1024**3)) end
Source
# File lib/vagrant-libvirt/util/byte_number.rb, line 2 def initialize(int) @int = int end
Public Instance Methods
Source
# File lib/vagrant-libvirt/util/byte_number.rb, line 50 def *(other) to_i * other end
Source
# File lib/vagrant-libvirt/util/byte_number.rb, line 42 def +(other) to_i + other end
Source
# File lib/vagrant-libvirt/util/byte_number.rb, line 46 def -(other) to_i - other end
Source
# File lib/vagrant-libvirt/util/byte_number.rb, line 54 def /(other) to_i / other end
Source
# File lib/vagrant-libvirt/util/byte_number.rb, line 38 def <=>(other) to_i <=> other end
Source
# File lib/vagrant-libvirt/util/byte_number.rb, line 34 def coerce(other) to_i.coerce(other) end
Source
# File lib/vagrant-libvirt/util/byte_number.rb, line 58 def pow(n) self.class.new(to_i ** n) end
Source
# File lib/vagrant-libvirt/util/byte_number.rb, line 30 def to_GB _compute_unit_to_n_kilo(3) end
Source
# File lib/vagrant-libvirt/util/byte_number.rb, line 22 def to_KB _compute_unit_to_n_kilo(1) end
Source
# File lib/vagrant-libvirt/util/byte_number.rb, line 26 def to_MB _compute_unit_to_n_kilo(2) end
Private Instance Methods
Source
# File lib/vagrant-libvirt/util/byte_number.rb, line 67 def _compute_unit_to_n_kilo(n=0) (to_f/(1024 ** n)).ceil end