class GHWikiTools::Snippet

Snippet is a small block text of wiki page.

Public Class Methods

dir() click to toggle source

Return snippetss directory.

# File lib/ghwikitools/snippet.rb, line 6
def dir
  GHWikiTools.dir + "snippet"
end

Public Instance Methods

render(page) click to toggle source

Render the snippet with the page.

@param page [Page]

the page that the snippet embeds in it
# File lib/ghwikitools/snippet.rb, line 15
def render(page)
  ERB.new(@path.read, nil, 2).result(SnippetContext.create(page))
end