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
Constant Summary collapse
- VERSION =
"0.1"
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
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/libexcel.rb', line 15 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
38 39 40 41 42 43 44 45 46 |
# File 'lib/libexcel.rb', line 38 def static(row, col) if col.nil? "R[#{row}]C" elsif row.nil? "RC[#{col}]" else "R[#{row}]C[#{col}]" end end |