Class: Docgenerator::Creole::Creole_inclusion_and_plugin

Inherits:
Object
  • Object
show all
Defined in:
lib/docgenerator/creole/inclusion_and_plugins.rb

Overview

Dummy class for all inclusions and plugins. Used to check the correct definition.

  • Inclusions are used later with {xx}

  • Plugins are used later with <<xx>>

Derived classes (Inclusions):

  • Creole_inclusion_img

  • Creole_inclusion_footnote_group

  • Creole_inclusion_footnote

Derived classes (Plugins):

  • Creole_default_plugin

  • Creole_plugin_ruby

  • Creole_plugin_ruby_raw

More subclasses may be possible.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(inclusionname, description, options, wiki) ⇒ Creole_inclusion_and_plugin

Example:

{{inclusionname|description|option1=1,option2=2}}

Parameters:

  • inclusionname: Name of the inclusion (normally fix for an instance, unless e.g. Creole_inclusion_img)

  • description: First parameter of the plugin.

  • options: Array with the comma separated values. In the example:

    ['option1=1','option2=2']
    
  • wiki: creole-instance, where the plugin/inclusion is defined.



55
56
57
58
59
60
61
62
# File 'lib/docgenerator/creole/inclusion_and_plugins.rb', line 55

def initialize( inclusionname, description, options, wiki )
  @inclusionname = inclusionname
  @description = description
  @options = options
  @wiki = wiki
  
  raise "Inclusion received no wiki but #{wiki.inspect}" unless wiki.is_a?(Creole)
end

Instance Attribute Details

#wikiObject (readonly)

Reader for the wiki.



64
65
66
# File 'lib/docgenerator/creole/inclusion_and_plugins.rb', line 64

def wiki
  @wiki
end

Class Method Details

.set_inclusions_key(key) ⇒ Object

Define class as a Inclusion. You may use the class as:

{{key}}


75
76
77
# File 'lib/docgenerator/creole/inclusion_and_plugins.rb', line 75

def set_inclusions_key(key)
  Inclusions::Collection[key] = self
end

.set_plugin_key(key) ⇒ Object

Define class as a Plugin. You may use the class as:

<<key>>


83
84
85
# File 'lib/docgenerator/creole/inclusion_and_plugins.rb', line 83

def set_plugin_key(key)
  Plugins::Collection[key] = self
end