Class: Writecast::Page

Inherits:
Document show all
Defined in:
lib/writecast/models.rb

Instance Attribute Summary

Attributes inherited from Document

#body, #file_path, #link_path, #raw_file_path, #summary, #tags, #time, #title

Instance Method Summary collapse

Constructor Details

#initialize(file_path) ⇒ Page

Returns a new instance of Page.



77
78
79
80
81
# File 'lib/writecast/models.rb', line 77

def initialize(file_path)
    super
    @link_path = "/%s.html" % CGI.escape(@title)
    @file_path = "/%s.html" % @title
end

Instance Method Details

#to_html(pages) ⇒ Object



83
84
85
86
87
# File 'lib/writecast/models.rb', line 83

def to_html(pages)
    title_tag = SITE_TITLE + SEPARATOR + @title
    Page_view.new(:doc => self, :pages => pages, :title_tag => title_tag
                 ).to_html(:prettyprint => PRETTY_HTML)
end