class Tablo::RowGroup(T)
- Tablo::RowGroup(T)
- Reference
- Object
Overview
Each time the source is read, an instance of the RowGroup class is created to display Body and all other preceeding possible row types and rule types.
The main purpose of the RowGroup class is to manage the alternation of different row types and their separating rule types.
To do this, the previous and current row types are used to determine the rule type and deduce border position to be used (see ROWTYPE_POSITION below).
From one instance to the next, the RowGroup class has no memory: the Table.rowtype_memory class variable is therefore used to ensure the link: when a new instance of RowGroup is created, the previous_rowtype instance variable is initialized by Table.rowtype_memory, and on exit from RowGroup's run method, the current_rowtype instance variable is assigned to Table.rowtype_memory.
Linking conditions between table :main and table :summary is governed by the class variable Table.transition_footer, where we store the footer of :main or nil, depending of the last rowtype of :main. This info is then use on first row of :summary to properly link or not the two tables.
Defined in:
rowgroup.crConstant Summary
-
ROWTYPE_POSITION =
{ {RowType::Body, RowType::Body} => Position::BodyBody, {RowType::Body, :bottom} => Position::BodyBottom, {RowType::Body, :filler} => Position::BodyFiller, {RowType::Body, RowType::Group} => Position::BodyGroup, {RowType::Body, RowType::Header} => Position::BodyHeader, {RowType::Body, RowType::Footer} => Position::BodyTitle, {RowType::Body, RowType::Title} => Position::BodyTitle, {RowType::Body, :top} => Position::BodyTop, {RowType::Group, RowType::Header} => Position::GroupHeader, {RowType::Group, :top} => Position::GroupTop, {RowType::Header, RowType::Body} => Position::HeaderBody, {RowType::Header, :top} => Position::HeaderTop, {:summary, RowType::Body} => Position::SummaryBody, {:summary, RowType::Header} => Position::SummaryHeader, {RowType::Footer, RowType::Body} => Position::TitleBody, {RowType::Title, RowType::Body} => Position::TitleBody, {RowType::Footer, :bottom} => Position::TitleBottom, {RowType::SubTitle, :bottom} => Position::TitleBottom, {RowType::Title, :bottom} => Position::TitleBottom, {RowType::Footer, RowType::Group} => Position::TitleGroup, {RowType::SubTitle, RowType::Group} => Position::TitleGroup, {RowType::Title, RowType::Group} => Position::TitleGroup, {RowType::Footer, RowType::Header} => Position::TitleHeader, {RowType::SubTitle, RowType::Header} => Position::TitleHeader, {RowType::Title, RowType::Header} => Position::TitleHeader, {RowType::Footer, RowType::Title} => Position::TitleTitle, {RowType::Title, RowType::SubTitle} => Position::TitleTitle, {RowType::Title, RowType::Title} => Position::TitleTitle, {RowType::Footer, :top} => Position::TitleTop, {RowType::SubTitle, :top} => Position::TitleTop, {RowType::Title, :top} => Position::TitleTop}
Constructors
Instance Method Summary
- #add_row(rows, linenum = 0)
- #add_rowtype
- #add_rule(position, groups = nil, linenum = 0)
- #close_table
-
#current_rowtype : RowType | Nil
property previous_rowtype : RowType? = Table.previous_rowtype
-
#current_rowtype=(current_rowtype : RowType | Nil)
property previous_rowtype : RowType? = Table.previous_rowtype
- #framed?(rowtype)
-
#previous_rowtype : RowType | Nil
Whenever we enter rowgroup, we retrieve the previous rowtype from the recorded value in class variable Table.rowtype_memory
-
#previous_rowtype=(previous_rowtype : RowType | Nil)
Whenever we enter rowgroup, we retrieve the previous rowtype from the recorded value in class variable Table.rowtype_memory
- #rows
- #rows=(rows : Array(String))
- #run
Constructor Detail
Instance Method Detail
property previous_rowtype : RowType? = Table.previous_rowtype
property previous_rowtype : RowType? = Table.previous_rowtype
Whenever we enter rowgroup, we retrieve the previous rowtype from the recorded value in class variable Table.rowtype_memory
Whenever we enter rowgroup, we retrieve the previous rowtype from the recorded value in class variable Table.rowtype_memory