Class: Numeric

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

Constant Summary collapse

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

Instance Method Summary collapse

Instance Method Details

#vdevObject


5
6
7
8
9
# File 'lib/vagrant-libvirt/config.rb', line 5

def vdev
  s, q = '', self
  (q, r = (q - 1).divmod(26)) && s.prepend(Alphabet[r]) until q.zero?
  'vd'+s
end