Class: Ircbot::Plugin
Defined Under Namespace
Classes: InitialMessage, Null
Instance Attribute Summary collapse
-
#message ⇒ Object
Returns the value of attribute message.
-
#plugin_name ⇒ Object
Returns the value of attribute plugin_name.
-
#plugins ⇒ Object
Returns the value of attribute plugins.
-
#running ⇒ Object
Returns the value of attribute running.
Instance Method Summary collapse
-
#help ⇒ Object
Operations.
-
#initialize(plugins = nil) ⇒ Plugin
constructor
A new instance of Plugin.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(plugins = nil) ⇒ Plugin
Returns a new instance of Plugin.
22 23 24 25 26 |
# File 'lib/ircbot/plugin.rb', line 22 def initialize(plugins = nil) @plugins = plugins || Plugins.new @message = InitialMessage.new(self.class.name) @running = false end |
Instance Attribute Details
#message ⇒ Object
Returns the value of attribute message.
17 18 19 |
# File 'lib/ircbot/plugin.rb', line 17 def @message end |
#plugin_name ⇒ Object
Returns the value of attribute plugin_name.
20 21 22 |
# File 'lib/ircbot/plugin.rb', line 20 def plugin_name @plugin_name end |
#plugins ⇒ Object
Returns the value of attribute plugins.
18 19 20 |
# File 'lib/ircbot/plugin.rb', line 18 def plugins @plugins end |
#running ⇒ Object
Returns the value of attribute running.
19 20 21 |
# File 'lib/ircbot/plugin.rb', line 19 def running @running end |
Instance Method Details
#help ⇒ Object
Operations
48 49 50 |
# File 'lib/ircbot/plugin.rb', line 48 def help raise "no helps for #{plugin_name}" end |
#inspect ⇒ Object
37 38 39 |
# File 'lib/ircbot/plugin.rb', line 37 def inspect "<%sPlugin: %s>" % [running ? '*' : '', plugin_name] end |
#to_s ⇒ Object
41 42 43 |
# File 'lib/ircbot/plugin.rb', line 41 def to_s "%s%s" % [running ? '*' : '', plugin_name] end |