Class: RubyCoded::Plugins::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_coded/plugins/base.rb

Overview

Abstract base class for all plugins. Subclass this and override the class methods to declare what your plugin contributes.

Direct Known Subclasses

CommandCompletion::Plugin

Class Method Summary collapse

Class Method Details

.command_descriptionsObject

Hash mapping command strings to human-readable descriptions, e.g. { “/deploy” => “Deploy the application” }



40
# File 'lib/ruby_coded/plugins/base.rb', line 40

def command_descriptions = {}

.command_handler_extensionObject

Module to include in Chat::CommandHandler (or nil).



24
# File 'lib/ruby_coded/plugins/base.rb', line 24

def command_handler_extension = nil

.commandsObject

Hash mapping command strings to method symbols, e.g. { “/deploy” => :cmd_deploy }



36
# File 'lib/ruby_coded/plugins/base.rb', line 36

def commands = {}

.input_extensionObject

Module to include in Chat::InputHandler (or nil).



18
# File 'lib/ruby_coded/plugins/base.rb', line 18

def input_extension = nil

.input_handler_methodObject

Symbol — method name defined by input_extension that processes keyboard events. Signature: method(event) -> action_symbol | nil



28
# File 'lib/ruby_coded/plugins/base.rb', line 28

def input_handler_method = nil

.plugin_nameObject

Unique identifier for the plugin (Symbol).

Raises:

  • (NotImplementedError)


10
11
12
# File 'lib/ruby_coded/plugins/base.rb', line 10

def plugin_name
  raise NotImplementedError, "#{name} must implement .plugin_name"
end

.render_methodObject

Symbol — method name defined by renderer_extension that draws the plugin overlay. Signature: method(frame, chat_area, input_area)



32
# File 'lib/ruby_coded/plugins/base.rb', line 32

def render_method = nil

.renderer_extensionObject

Module to include in Chat::Renderer (or nil).



21
# File 'lib/ruby_coded/plugins/base.rb', line 21

def renderer_extension = nil

.state_extensionObject

Module to include in Chat::State (or nil).



15
# File 'lib/ruby_coded/plugins/base.rb', line 15

def state_extension = nil