Class: GHWikiTools::SnippetContext

Inherits:
Object
  • Object
show all
Defined in:
lib/ghwikitools/snippet.rb

Overview

SnippetContext provides snippet rendering informations.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(page) ⇒ SnippetContext

Returns a new instance of SnippetContext.

Parameters:

  • page (Page)

    the page that the snippet embeds in it



36
37
38
# File 'lib/ghwikitools/snippet.rb', line 36

def initialize(page)
  @page = page
end

Class Method Details

.create(page) ⇒ Binding

Return the context as binding object.

Parameters:

  • page (Page)

    the page that the snippet embeds in it

Returns:

  • (Binding)

    snippet context as binding object



29
30
31
# File 'lib/ghwikitools/snippet.rb', line 29

def create(page)
  new(page).binding
end

Instance Method Details

#bindingBinding

Return the environment binding object.

Returns:

  • (Binding)

    the environment binding object



44
45
46
# File 'lib/ghwikitools/snippet.rb', line 44

def binding
  Kernel.binding
end