Class: DaimonMarkdown::Plugin

Inherits:
Object
  • Object
show all
Defined in:
lib/daimon_markdown/plugin.rb,
lib/daimon_markdown/plugin/toc.rb,
lib/daimon_markdown/plugin/base.rb,
lib/daimon_markdown/plugin/chat.rb,
lib/daimon_markdown/plugin/math.rb,
lib/daimon_markdown/plugin/figure.rb

Defined Under Namespace

Classes: Base, Chat, Error, Figure, Math, TableOfContents, UnknownPluginError

Constant Summary collapse

PLUGIN_REGISTRY =
{}

Class Method Summary collapse

Class Method Details

.lookup(name) ⇒ Object



13
14
15
16
17
# File 'lib/daimon_markdown/plugin.rb', line 13

def lookup(name)
  PLUGIN_REGISTRY.fetch(name)
rescue KeyError
  raise UnknownPluginError, "Unknown plugin: #{name}"
end

.register(name, klass) ⇒ Object



19
20
21
# File 'lib/daimon_markdown/plugin.rb', line 19

def register(name, klass)
  PLUGIN_REGISTRY[name] = klass
end