Class: CSVPlusPlus::Cell
- Inherits:
-
Object
- Object
- CSVPlusPlus::Cell
- Extended by:
- T::Sig
- Defined in:
- lib/csv_plus_plus/cell.rb
Overview
A cell of a template
Instance Attribute Summary collapse
-
#ast ⇒ Entity?
The AST of the formula in the cell (if there is one).
-
#index ⇒ Integer
readonly
The cell’s index (starts at 0).
-
#modifier ⇒ Modifier
readonly
The modifier for this cell.
-
#row_index ⇒ Integer
The cell’s row index (starts at 0).
Instance Method Summary collapse
-
#initialize(index:, modifier:, row_index:, value:) ⇒ Cell
constructor
A new instance of Cell.
-
#value ⇒ ::String
The @value (cleaned up some).
Constructor Details
#initialize(index:, modifier:, row_index:, value:) ⇒ Cell
Returns a new instance of Cell.
38 39 40 41 42 43 |
# File 'lib/csv_plus_plus/cell.rb', line 38 def initialize(index:, modifier:, row_index:, value:) @value = value @modifier = modifier @index = index @row_index = row_index end |
Instance Attribute Details
#ast ⇒ Entity?
The AST of the formula in the cell (if there is one)
11 12 13 |
# File 'lib/csv_plus_plus/cell.rb', line 11 def ast @ast end |
#index ⇒ Integer (readonly)
The cell’s index (starts at 0)
11 12 13 |
# File 'lib/csv_plus_plus/cell.rb', line 11 def index @index end |
#modifier ⇒ Modifier (readonly)
The modifier for this cell
11 12 13 |
# File 'lib/csv_plus_plus/cell.rb', line 11 def modifier @modifier end |
#row_index ⇒ Integer
The cell’s row index (starts at 0)
11 12 13 |
# File 'lib/csv_plus_plus/cell.rb', line 11 def row_index @row_index end |
Instance Method Details
#value ⇒ ::String
The @value (cleaned up some)
49 50 51 52 53 |
# File 'lib/csv_plus_plus/cell.rb', line 49 def value stripped = @value&.strip stripped&.empty? ? nil : stripped end |