Module: Arproxy::Plugin
- Defined in:
- lib/arproxy/plugin.rb
Class Method Summary collapse
Class Method Details
.get(name) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/arproxy/plugin.rb', line 15 def get(name) name = name.to_s require "arproxy/plugin/#{name}" plugin = @plugins[name] unless plugin raise Arproxy::Error, "Plugin is not found: #{name}" end plugin end |
.register(name, klass) ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/arproxy/plugin.rb', line 4 def register(name, klass) name = name.to_s @plugins ||= {} if @plugins.has_key?(name) raise Arproxy::Error, "Plugin has already been registered: #{name}" end @plugins[name] = klass end |