Module: LibExcel
- Defined in:
- lib/libexcel.rb,
lib/libexcel/formula.rb,
lib/libexcel/document.rb,
lib/libexcel/worksheet.rb
Defined Under Namespace
Classes: Document, Formula, Worksheet
Class Method Summary collapse
-
.range(args) ⇒ String
Creates the full Excel XML equation string.
-
.static(row, col) ⇒ String
Creates part of the Excel XML style equation string.
Class Method Details
.range(args) ⇒ String
Creates the full Excel XML equation string
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/libexcel.rb', line 13 def range(args) if args[:cols].nil? (buf = static(args[:rows].first, args[:col])) << ':' buf << static(args[:rows].last, args[:col]) elsif args[:rows].nil? (buf = static(args[:row], args[:cols].first)) << ':' buf << static(args[:row], args[:cols].last) else (buf = static(args[:rows].first, args[:cols].first)) << ':' buf << static(args[:rows].last, args[:cols].last) end end |
.static(row, col) ⇒ String
Creates part of the Excel XML style equation string
36 37 38 39 40 41 42 43 44 |
# File 'lib/libexcel.rb', line 36 def static(row, col) if col.nil? "R[#{row}]C" elsif row.nil? "RC[#{col}]" else "R[#{row}]C[#{col}]" end end |