Module: Sashite::Cell::Formatter Private
- Defined in:
- lib/sashite/cell/formatter.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Formats index arrays into CELL coordinate strings.
This module handles the conversion from numeric indices to their CELL string representation following the cyclic pattern:
-
Dimension 1, 4, 7…: lowercase letters (a-z, aa-iv)
-
Dimension 2, 5, 8…: positive integers (1-256)
-
Dimension 3, 6, 9…: uppercase letters (A-Z, AA-IV)
Class Method Summary collapse
-
.indices_to_string(indices) ⇒ String
private
Formats an indices array to a CELL string.
Class Method Details
.indices_to_string(indices) ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Formats an indices array to a CELL string.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/sashite/cell/formatter.rb', line 27 def self.indices_to_string(indices) result = +"" indices.each_with_index do |index, i| dimension_type = i % 3 result << case dimension_type when 0 then encode_to_lower(index) when 1 then encode_to_number(index) when 2 then encode_to_upper(index) end end result.freeze end |