Class: GHWikiTools::Snippet
Overview
Snippet is a small block text of wiki page.
Instance Attribute Summary
Attributes inherited from Page
Class Method Summary collapse
-
.dir ⇒ Object
Return snippetss directory.
Instance Method Summary collapse
-
#render(page) ⇒ Object
Render the snippet with the page.
Methods inherited from Page
all, by_filename, #delete_snippet, #find_snippets, #include_snippet?, #initialize, #insert_footer, #insert_header, #render_snippets, #update_snippets, #valid?, #wikiname
Constructor Details
This class inherits a constructor from GHWikiTools::Page
Class Method Details
.dir ⇒ Object
Return snippetss directory.
6 7 8 |
# File 'lib/ghwikitools/snippet.rb', line 6 def dir GHWikiTools.dir + "snippet" end |
Instance Method Details
#render(page) ⇒ Object
Render the snippet with the page.
15 16 17 |
# File 'lib/ghwikitools/snippet.rb', line 15 def render(page) ERB.new(@path.read, nil, 2).result(SnippetContext.create(page)) end |