Class: Numeric

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-libvirt/config.rb

Direct Known Subclasses

ByteNumber

Constant Summary collapse

Alphabet =
('a'..'z').to_a

Instance Method Summary collapse

Instance Method Details

#vdevObject



9
10
11
12
13
14
# File 'lib/vagrant-libvirt/config.rb', line 9

def vdev
  s = String.new
  q = self
  (q, r = (q - 1).divmod(26)) && s.prepend(Alphabet[r]) until q.zero?
  "vd#{s}"
end