Class: Idml::Elements::Column

Inherits:
Lutaml::Model::Serializable
  • Object
show all
Defined in:
lib/idml/elements/column.rb

Overview

<Column> — a column definition within an IDML Table. Carries the column's width (SingleColumnWidth), type (HeaderColumn / BodyColumn), insets, and visual properties (fill, diagonal lines).

Schema: Column_Object in reference-docs/schemas/package/Stories/Story.rnc. Real IDML tables have <Column> children alongside <Row> and <Cell> siblings. The Name attribute is the column index as a string (e.g., "0", "1", "2").

The renderer's SchemaLayout reads SingleColumnWidth per column to compute per-column x positions and widths (replaces the even-division / uniform-width fallback).

Instance Method Summary collapse

Instance Method Details

#indexObject

Column Name is a string integer (e.g., "0", "1"). Returns the integer index or nil if Name is missing/invalid.



38
39
40
41
42
# File 'lib/idml/elements/column.rb', line 38

def index
  return nil unless name

  Integer(name, 10, exception: false) # rubocop:disable Style/RescueModifier
end