Class: Index

Inherits:
Zarchitect show all
Defined in:
lib/zarchitect/index.rb

Constant Summary

Constants inherited from Zarchitect

Zarchitect::ASSETDIR, Zarchitect::ASSETSDIR, Zarchitect::BUILDIR, Zarchitect::CONFIGDIR, Zarchitect::DEBUGSDIR, Zarchitect::DRAFTDIR, Zarchitect::FILEDIR, Zarchitect::FILESDIR, Zarchitect::HTMLDIR, Zarchitect::LAYOUTDIR, Zarchitect::NODEDIR, Zarchitect::SHARESDIR, Zarchitect::VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Zarchitect

#main, #rss

Constructor Details

#initialize(parent) ⇒ Index

Returns a new instance of Index.



4
5
6
7
8
9
10
11
12
# File 'lib/zarchitect/index.rb', line 4

def initialize(parent)
  @pages = Array.new
  @parent = parent
  @ptype = @parent.class.to_s
  # index owns paginator
  # owns the index files which share its paginator
  setup_paginator
  setup_html
end

Instance Attribute Details

#pagesObject (readonly)

Returns the value of attribute pages.



2
3
4
# File 'lib/zarchitect/index.rb', line 2

def pages
  @pages
end

Instance Method Details

#build_htmlObject



14
15
16
17
18
# File 'lib/zarchitect/index.rb', line 14

def build_html
  @html.each do |h|
    h.compose 
  end
end

#write_htmlObject



20
21
22
23
24
25
# File 'lib/zarchitect/index.rb', line 20

def write_html
  @html.each do |h|
    GPI.print "Writing index HTML.", GPI::CLU.check_option('v')
    h.write
  end
end