<aside> 👉
Links (Block base class)
Notion Ruby Mapping Public API Reference
</aside>
self.new(array_array_of_text_objects = [], _table_width = 3) → TableRowBlockCreates one row of a table. Each outer Array element represents one cell, and each cell is converted to an Array of rich text objects.
Array<String> ... one String per cellArray<TextObject> ... one rich text object per cell[] as a cell ... an empty rich text Array for that cell[] ... creates an empty row objectTableRowBlockrow = TableRowBlock.new(
[
"Name",
["hkob\n", TextObject.new("profile", "href" => "<https://example.com/>")],
[],
],
)
<aside> ⚠️
A TableRowBlock is a public API and can be created independently, but it can only be appended as a child of a TableBlock. The row width is checked by the table when the row is added or the table is serialized.
</aside>
Returns the cells as an Array. Each cell is an Array of rich text objects. An empty cell is represented by an empty Array, while an empty String remains one rich text object whose content is empty.
row = TableRowBlock.new(["First", %w[Second Third], []])
row.cells
# => [[#<NotionRubyMapping::TextObject:...>],
# [#<NotionRubyMapping::TextObject:...>, #<NotionRubyMapping::TextObject:...>],
# []]
Replaces the complete cells Array and marks cells for the next row-block update. NotionRubyMapping does not provide a separate public API for updating one cell; modify the current values and assign the complete Array through cells=.
self.newArgumentError ... raised with cells must be an array when the argument is not an ArrayStandardError ... raised when changing the number of cells in a saved rowrow = Block.find "table_row_block_id"
row.cells = %w[Updated Values]
row.save