Module: Kscript::Plugin

Defined in:
lib/kscript.rb

Overview

fluentd 风格插件注册机制

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.pluginsObject (readonly)

Returns the value of attribute plugins.



39
40
41
# File 'lib/kscript.rb', line 39

def plugins
  @plugins
end

Class Method Details

.[](name) ⇒ Object



45
46
47
# File 'lib/kscript.rb', line 45

def [](name)
  @plugins[name.to_sym]
end

.allObject



49
50
51
# File 'lib/kscript.rb', line 49

def all
  @plugins
end

.register(name, klass) ⇒ Object



41
42
43
# File 'lib/kscript.rb', line 41

def register(name, klass)
  @plugins[name.to_sym] = klass
end