class Asciidoctor::Table::Rows
Public: A data object that encapsulates the collection of rows (head, foot, body) for a table
Attributes
Public Class Methods
Source
# File lib/asciidoctor/table.rb, line 13 def initialize head = [], foot = [], body = [] @head = head @foot = foot @body = body end
Public Instance Methods
Source
# File lib/asciidoctor/table.rb, line 28 def by_section [[:head, @head], [:body, @body], [:foot, @foot]] end
Public: Retrieve the rows grouped by section as a nested Array
.
Creates a 2-dimensional array of two element entries. The first element is the section name as a symbol. The second element is the Array
of rows in that section. The entries are in document order (head, foot, body).
Returns a 2-dimentional Array
of rows grouped by section.
Source
# File lib/asciidoctor/table.rb, line 38 def to_h { head: @head, body: @body, foot: @foot } end
Public: Retrieve the rows as a Hash
.
The keys are the names of the section groups and the values are the Array
of rows in that section. The keys are in document order (head, foot, body).
Returns a Hash
of rows grouped by section.