Class: Defacer::Namer
- Inherits:
-
Object
- Object
- Defacer::Namer
- Defined in:
- lib/defacer/namer.rb
Class Method Summary collapse
-
.name_var_at_index(index) ⇒ Object
TODO simplify, and speed up this code.
Class Method Details
.name_var_at_index(index) ⇒ Object
TODO simplify, and speed up this code
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/defacer/namer.rb', line 4 def self.name_var_at_index(index) v = '' loop do mod = index % 26 v = (mod + 97).chr + v index = (index / 26) - 1 break if index < 0 end v end |