Class: CrazyDoll::PluginManager::Config
- Inherits:
-
Object
- Object
- CrazyDoll::PluginManager::Config
- Defined in:
- lib/crazy_doll/plugin_manager.rb
Instance Attribute Summary collapse
-
#custom_messages ⇒ Object
readonly
Returns the value of attribute custom_messages.
-
#gems ⇒ Object
readonly
Returns the value of attribute gems.
-
#keys ⇒ Object
readonly
Returns the value of attribute keys.
-
#plugins ⇒ Object
readonly
Returns the value of attribute plugins.
Instance Method Summary collapse
- #gem(name, opts = {}) ⇒ Object
-
#initialize(klass) ⇒ Config
constructor
A new instance of Config.
- #key(name, value, description = '') ⇒ Object
- #plugin(name, opts = {}) ⇒ Object
- #register(name, line, method, where = [:chan, :priv], regexp = nil) ⇒ Object
Constructor Details
#initialize(klass) ⇒ Config
Returns a new instance of Config.
119 120 121 122 |
# File 'lib/crazy_doll/plugin_manager.rb', line 119 def initialize(klass) @klass = klass @gems, @plugins, @keys, @custom_messages = {}, {}, {}, [] end |
Instance Attribute Details
#custom_messages ⇒ Object (readonly)
Returns the value of attribute custom_messages.
118 119 120 |
# File 'lib/crazy_doll/plugin_manager.rb', line 118 def @custom_messages end |
#gems ⇒ Object (readonly)
Returns the value of attribute gems.
118 119 120 |
# File 'lib/crazy_doll/plugin_manager.rb', line 118 def gems @gems end |
#keys ⇒ Object (readonly)
Returns the value of attribute keys.
118 119 120 |
# File 'lib/crazy_doll/plugin_manager.rb', line 118 def keys @keys end |
#plugins ⇒ Object (readonly)
Returns the value of attribute plugins.
118 119 120 |
# File 'lib/crazy_doll/plugin_manager.rb', line 118 def plugins @plugins end |
Instance Method Details
#gem(name, opts = {}) ⇒ Object
124 125 126 |
# File 'lib/crazy_doll/plugin_manager.rb', line 124 def gem(name, opts = {}) @gems[name.to_sym] = opts end |
#key(name, value, description = '') ⇒ Object
132 133 134 |
# File 'lib/crazy_doll/plugin_manager.rb', line 132 def key(name, value, description='') @keys[name.to_sym] = [description, value] end |
#plugin(name, opts = {}) ⇒ Object
128 129 130 |
# File 'lib/crazy_doll/plugin_manager.rb', line 128 def plugin(name, opts = {}) @plugins[name.to_sym] = opts end |
#register(name, line, method, where = [:chan, :priv], regexp = nil) ⇒ Object
136 137 138 139 140 |
# File 'lib/crazy_doll/plugin_manager.rb', line 136 def register(name, line, method, where=[:chan, :priv], regexp=nil) line = '' unless line.is_a?(String) line = "#{name}#{line.empty? ? '' : ' ' + line}" @custom_messages << [regexp || line.to_crazy_doll_regexp, line, method, [where].flatten] end |