Class: Proforma::Modeling::Table
- Inherits:
-
Object
- Object
- Proforma::Modeling::Table
- Defined in:
- lib/proforma/modeling/table.rb,
lib/proforma/modeling/table/row.rb,
lib/proforma/modeling/table/cell.rb,
lib/proforma/modeling/table/section.rb
Overview
A basic table structure modeled off of an HTML table: A table has three sections: header, body, footer. Each section has rows. Each row has cells.
Defined Under Namespace
Instance Attribute Summary collapse
Instance Method Summary collapse
- #compile(data, evaluator) ⇒ Object
-
#initialize(body: Section.new, footer: Section.new, header: Section.new) ⇒ Table
constructor
A new instance of Table.
Constructor Details
#initialize(body: Section.new, footer: Section.new, header: Section.new) ⇒ Table
Returns a new instance of Table.
25 26 27 28 29 |
# File 'lib/proforma/modeling/table.rb', line 25 def initialize(body: Section.new, footer: Section.new, header: Section.new) @body = Section.make(body) @footer = Section.make() @header = Section.make(header) end |
Instance Attribute Details
#body ⇒ Object
31 32 33 |
# File 'lib/proforma/modeling/table.rb', line 31 def body @body || Section.new end |
Instance Method Details
#compile(data, evaluator) ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/proforma/modeling/table.rb', line 43 def compile(data, evaluator) self.class.new( body: body.compile(data, evaluator), footer: .compile(data, evaluator), header: header.compile(data, evaluator) ) end |