Class: Cinch::PluginList
- Inherits:
-
Array
- Object
- Array
- Cinch::PluginList
- Defined in:
- lib/cinch/plugin_list.rb
Overview
Instance Method Summary (collapse)
-
- (PluginList) initialize(bot)
constructor
A new instance of PluginList.
-
- (Object) register_plugin(plugin)
-
- (Object) register_plugins(plugins)
-
- (Object) unregister_all
-
- (Object) unregister_plugin(plugin)
-
- (Object) unregister_plugins(plugins)
Constructor Details
- (PluginList) initialize(bot)
A new instance of PluginList
4 5 6 7 |
# File 'lib/cinch/plugin_list.rb', line 4 def initialize(bot) @bot = bot super() end |
Instance Method Details
- (Object) register_plugin(plugin)
10 11 12 |
# File 'lib/cinch/plugin_list.rb', line 10 def register_plugin(plugin) self << plugin.new(@bot) end |
- (Object) register_plugins(plugins)
15 16 17 |
# File 'lib/cinch/plugin_list.rb', line 15 def register_plugins(plugins) plugins.each { |plugin| register_plugin(plugin) } end |
- (Object) unregister_all
34 35 36 |
# File 'lib/cinch/plugin_list.rb', line 34 def unregister_all unregister_plugins(self) end |
- (Object) unregister_plugin(plugin)
20 21 22 23 |
# File 'lib/cinch/plugin_list.rb', line 20 def unregister_plugin(plugin) plugin.unregister delete(plugin) end |
- (Object) unregister_plugins(plugins)
26 27 28 29 30 31 |
# File 'lib/cinch/plugin_list.rb', line 26 def unregister_plugins(plugins) if plugins == self plugins = self.dup end plugins.each { |plugin| unregister_plugin(plugin) } end |