Class: Rbxl::EmptyCell

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

Overview

Placeholder cell returned when a coordinate in a padded row has no data.

Used only when ReadOnlyWorksheet#each_row is called with pad_cells: true. The object carries the synthetic coordinate so that downstream code can still locate the slot in the worksheet grid.

cell = Rbxl::EmptyCell.new(coordinate: "C5")
cell.coordinate # => "C5"
cell.value      # => nil

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(coordinate:) ⇒ EmptyCell

Returns a new instance of EmptyCell.

Parameters:

  • coordinate (String)

    Excel-style coordinate



16
17
18
# File 'lib/rbxl/empty_cell.rb', line 16

def initialize(coordinate:)
  @coordinate = coordinate
end

Instance Attribute Details

#coordinateString (readonly)

Returns Excel-style coordinate such as “C5”.

Returns:

  • (String)

    Excel-style coordinate such as “C5”



13
14
15
# File 'lib/rbxl/empty_cell.rb', line 13

def coordinate
  @coordinate
end

Instance Method Details

#valuenil

Always nil; exposed so callers can treat Rbxl::EmptyCell like any other cell object without a type check.

Returns:

  • (nil)


24
25
26
# File 'lib/rbxl/empty_cell.rb', line 24

def value
  nil
end