Class: ListOf

Inherits:
Object
  • Object
show all
Defined in:
lib/coursegen/course/helpers/list_of.rb

Instance Method Summary collapse

Constructor Details

#initialize(markup_adaptor, data_adaptor, rows, cols, subsections, items) ⇒ ListOf

source: name of a section as a string rows: array with one or more of:

"pages"
"subsections"

subsections: array with one or more strings corresponding to subsection string in an item

.e.g. "/content/topics/arch/"

cols: array with one or more of:

:date
:number
:title
:homeworks

items: refers to nanoc’s @items (temp hack!)



15
16
17
18
19
20
21
22
# File 'lib/coursegen/course/helpers/list_of.rb', line 15

def initialize(markup_adaptor, data_adaptor, rows, cols, subsections, items)
  @mark = markup_adaptor
  @rows = rows
  @cols = cols
  @data = data_adaptor
  @subsections = subsections
  @items = items
end

Instance Method Details

#renderObject



24
25
26
27
28
29
30
# File 'lib/coursegen/course/helpers/list_of.rb', line 24

def render
  @mark.table_begin
  generate_headers
  generate_rows
  @mark.table_end
  @mark.render
end