Module: CultomePlayer::Plugins
- Includes:
- Alias, Gestures, Help, KeyboardSpecialKeys, Points
- Included in:
- CultomePlayer
- Defined in:
- lib/cultome_player/plugins.rb,
lib/cultome_player/plugins/help.rb,
lib/cultome_player/plugins/alias.rb,
lib/cultome_player/plugins/points.rb,
lib/cultome_player/plugins/gestures.rb,
lib/cultome_player/plugins/keyboard_special_keys.rb
Defined Under Namespace
Modules: Alias, Gestures, Help, KeyboardSpecialKeys, Points
Instance Method Summary collapse
- #clean_plugins ⇒ Object
-
#init_plugins ⇒ Object
Call init_plugin_<action> to initialize all the plugins that require it.
-
#plugin_command_sintax(cmd_name) ⇒ Regex
Get a command format for a command implemented by a plugin.
-
#plugin_config(plugin_name) ⇒ Hash
Lazy getter for plugins configurator.
-
#plugins_respond_to?(cmd_name) ⇒ Boolean
Check if a plugin implements the given command.
Methods included from KeyboardSpecialKeys
#init_plugin_keyboard_special_keys
Methods included from Gestures
Methods included from Points
Methods included from Alias
#command_alias, #description_alias, #respond_to?, #sintax_alias, #usage_alias
Methods included from Help
#command_help, #description_help, #sintax_help, #usage_help
Instance Method Details
#clean_plugins ⇒ Object
45 46 47 |
# File 'lib/cultome_player/plugins.rb', line 45 def clean_plugins methods.grep(/^clean_plugin_/).each{|method_name| send(method_name) } end |
#init_plugins ⇒ Object
Call init_plugin_<action> to initialize all the plugins that require it.
41 42 43 |
# File 'lib/cultome_player/plugins.rb', line 41 def init_plugins methods.grep(/^init_plugin_/).each{|method_name| send(method_name) } end |
#plugin_command_sintax(cmd_name) ⇒ Regex
Get a command format for a command implemented by a plugin
27 28 29 |
# File 'lib/cultome_player/plugins.rb', line 27 def plugin_command_sintax(cmd_name) return send("sintax_#{cmd_name}".to_sym) end |
#plugin_config(plugin_name) ⇒ Hash
Lazy getter for plugins configurator. Its a persistent store where plugin can put their configurations.
35 36 37 38 |
# File 'lib/cultome_player/plugins.rb', line 35 def plugin_config(plugin_name) plugin_ns = player_config['plugins'] ||= {} return plugin_ns[plugin_name.to_s] ||= {} end |
#plugins_respond_to?(cmd_name) ⇒ Boolean
Check if a plugin implements the given command.
19 20 21 |
# File 'lib/cultome_player/plugins.rb', line 19 def plugins_respond_to?(cmd_name) return respond_to?("command_#{cmd_name}".to_sym) end |