Class: Coradoc::CoreModel::TableRow

Inherits:
Base
  • Object
show all
Defined in:
lib/coradoc/core_model/table.rb

Overview

Represents a row in a table

A table row contains multiple cells and can be a header row or a data row.

Examples:

Creating a table row

row = CoreModel::TableRow.new(
  cells: [
    CoreModel::TableCell.new(content: "Name"),
    CoreModel::TableCell.new(content: "Value")
  ],
  header: true
)

Instance Attribute Summary collapse

Attributes inherited from Base

#element_attributes, #id, #metadata_entries, #title

Method Summary

Methods inherited from Base

#accept, #attr, #metadata, #semantically_equivalent?, #set_attr, #set_metadata

Instance Attribute Details

#cellsArray<TableCell>

Returns collection of cells in the row.

Returns:

  • (Array<TableCell>)

    collection of cells in the row



99
# File 'lib/coradoc/core_model/table.rb', line 99

attribute :cells, TableCell, collection: true

#headerBoolean

Returns whether this is a header row.

Returns:

  • (Boolean)

    whether this is a header row



103
# File 'lib/coradoc/core_model/table.rb', line 103

attribute :header, :boolean, default: -> { false }