class Category
Attributes
key[R]
name[R]
section[R]
url[R]
Public Class Methods
new(key, name, section)
click to toggle source
# File lib/zarchitect/category.rb, line 4 def initialize(key, name, section) @key = key @name = name @section = section @url = "/#{@section.key}/#{@key}/index.html" create_dir end
Public Instance Methods
build_html()
click to toggle source
# File lib/zarchitect/category.rb, line 13 def build_html if @tags @tags.each do |t| t.build_html end end @index.build_html end
posts()
click to toggle source
# File lib/zarchitect/category.rb, line 48 def posts @section.posts.select { |p| p.category == self } end
setup_index()
click to toggle source
# File lib/zarchitect/category.rb, line 52 def setup_index @index = Index.new(self) end
write_html()
click to toggle source
# File lib/zarchitect/category.rb, line 22 def write_html if @tags @tags.each do |t| t.write_html end end @index.write_html end
Private Instance Methods
create_dir()
click to toggle source
# File lib/zarchitect/category.rb, line 58 def create_dir Util.mkdir(File.join(HTMLDIR, @section.key, @key)) end