Class: Fixnum

Inherits:
Object
  • Object
show all
Defined in:
lib/oxcelix.rb

Instance Method Summary collapse

Instance Method Details

#col_nameString

Returns the column name corresponding to the given number. e.g: 1.col_name => 'B'


39
40
41
42
# File 'lib/oxcelix.rb', line 39

def col_name
  val=self/26
  (val > 0 ? (val - 1).col_name : "") + (self % 26 + 65).chr
end