xlsxrb 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,16 @@
3
3
  module Xlsxrb
4
4
  module Elements
5
5
  # Represents a single cell in a worksheet.
6
- # All indices are 0-based.
6
+ # All row and column indices are 0-based.
7
+ #
8
+ # @example Access cell properties
9
+ # cell = sheet["A1"]
10
+ # cell.value # raw value
11
+ # cell.ref # "A1"
12
+ # cell.to_i # integer value
13
+ # cell.to_date # Date value
14
+ #
15
+ # @api public
7
16
  class Cell < Data
8
17
  attr_reader row_index(): untyped
9
18
 
@@ -4,6 +4,11 @@ module Xlsxrb
4
4
  module Elements
5
5
  # Represents column formatting in a worksheet.
6
6
  # index is 0-based.
7
+ #
8
+ # @example
9
+ # col = Elements::Column.new(index: 0, width: 25.0)
10
+ #
11
+ # @api public
7
12
  class Column < Data
8
13
  attr_reader index(): untyped
9
14
 
@@ -3,7 +3,14 @@
3
3
  module Xlsxrb
4
4
  module Elements
5
5
  # Represents a single row in a worksheet.
6
- # index is 0-based.
6
+ # All row and column indices are 0-based.
7
+ #
8
+ # @example Access cell by index or symbol
9
+ # row = sheet.row_at(0)
10
+ # cell = row[0] # cell at column 0
11
+ # row.to_a # array of cell values
12
+ #
13
+ # @api public
7
14
  class Row < Data
8
15
  attr_reader index(): untyped
9
16
 
@@ -8,8 +8,12 @@ module Xlsxrb
8
8
 
9
9
  EMPTY_CELLS: untyped
10
10
 
11
- # Represents a formula with an optional cached value.
12
- # Optional: type (:shared, :array), ref (range), shared_index (si for shared formulas)
11
+ # Represents an Excel formula with an optional cached value and calculation properties.
12
+ #
13
+ # @example Create a formula
14
+ # formula = Elements::Formula.new(expression: "SUM(A1:A10)")
15
+ #
16
+ # @api public
13
17
  class Formula < Data
14
18
  attr_reader expression(): untyped
15
19
 
@@ -44,6 +48,7 @@ module Xlsxrb
44
48
  end
45
49
 
46
50
  # Represents a cell error value (e.g. #N/A, #REF!, #DIV/0!).
51
+ # @api public
47
52
  VALID_ERROR_CODES: untyped
48
53
 
49
54
  class CellError < Data
@@ -57,9 +62,12 @@ module Xlsxrb
57
62
  def members: () -> [ :code ]
58
63
  end
59
64
 
60
- # Represents a rich text string with formatting runs.
61
- # runs: array of hashes, each with :text and optional :font (hash of font properties).
62
- # Font properties: :bold, :italic, :underline, :sz, :color, :name
65
+ # Represents a rich text string with multiple formatting runs.
66
+ #
67
+ # @example
68
+ # rt = Elements::RichText.new(runs: [{ text: "Hello ", font: { bold: true } }, { text: "World" }])
69
+ #
70
+ # @api public
63
71
  class RichText < Data
64
72
  attr_reader runs(): untyped
65
73
 
@@ -2,7 +2,14 @@
2
2
 
3
3
  module Xlsxrb
4
4
  module Elements
5
- # Represents an entire XLSX workbook.
5
+ # Represents an entire in-memory XLSX workbook.
6
+ #
7
+ # @example Access sheets
8
+ # workbook = Xlsxrb.read("report.xlsx")
9
+ # sheet = workbook.sheet(0) # or workbook["Sheet1"]
10
+ # workbook.each { |s| puts s.name }
11
+ #
12
+ # @api public
6
13
  class Workbook < Data
7
14
  attr_reader sheets(): untyped
8
15
 
@@ -3,6 +3,13 @@
3
3
  module Xlsxrb
4
4
  module Elements
5
5
  # Represents a single worksheet in a workbook.
6
+ #
7
+ # @example Access cells and rows
8
+ # sheet = workbook.sheet(0)
9
+ # cell = sheet["A1"]
10
+ # sheet.each_row { |row| puts row.to_a.inspect }
11
+ #
12
+ # @api public
6
13
  class Worksheet < Data
7
14
  attr_reader name(): untyped
8
15