class Proforma::Modeling::Table

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.

Attributes

body[W]
header[W]

Public Class Methods

new(body: Section.new, footer: Section.new, header: Section.new) click to toggle source
# 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(footer)
  @header = Section.make(header)
end

Public Instance Methods

body() click to toggle source
# File lib/proforma/modeling/table.rb, line 31
def body
  @body || Section.new
end
compile(data, evaluator) click to toggle source
# File lib/proforma/modeling/table.rb, line 43
def compile(data, evaluator)
  self.class.new(
    body: body.compile(data, evaluator),
    footer: footer.compile(data, evaluator),
    header: header.compile(data, evaluator)
  )
end
header() click to toggle source
# File lib/proforma/modeling/table.rb, line 39
def header
  @header || Section.new
end