Class: Proforma::Modeling::Table
- Inherits:
-
Object
- Object
- Proforma::Modeling::Table
show all
- 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
Classes: Cell, Row, Section
Instance Attribute Summary collapse
Instance Method Summary
collapse
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)
= Section.make()
= Section.make()
end
|
Instance Attribute Details
#body ⇒ Object
31
32
33
|
# File 'lib/proforma/modeling/table.rb', line 31
def body
@body || Section.new
end
|
35
36
37
|
# File 'lib/proforma/modeling/table.rb', line 35
def
|| Section.new
end
|
39
40
41
|
# File 'lib/proforma/modeling/table.rb', line 39
def
|| 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: .compile(data, evaluator)
)
end
|