Class: Pluginf
- Inherits:
-
Object
- Object
- Pluginf
- Defined in:
- lib/rirc.rb
Instance Method Summary collapse
- #add_chan(channel) ⇒ Object
- #chans ⇒ Object
- #cleanup ⇒ Object
- #file_name ⇒ Object
- #help ⇒ Object
-
#initialize(regex, name, file_name, help, chan_list) ⇒ Pluginf
constructor
A new instance of Pluginf.
- #name ⇒ Object
- #regex ⇒ Object
- #rm_chan(channel) ⇒ Object
-
#script(message, nick, chan) ⇒ Object
default function.
Constructor Details
#initialize(regex, name, file_name, help, chan_list) ⇒ Pluginf
Returns a new instance of Pluginf.
69 70 71 72 73 74 75 76 |
# File 'lib/rirc.rb', line 69 def initialize(regex, name, file_name, help) @regexp = Regexp.new(regex.to_s) @name = name.to_s @file_name = file_name.to_s @help = help @chan_list = [] @chan_list.push("any") end |
Instance Method Details
#add_chan(channel) ⇒ Object
119 120 121 |
# File 'lib/rirc.rb', line 119 def add_chan(channel) if !@chan_list.include? channel then @chan_list.push(channel) end end |
#chans ⇒ Object
95 96 97 |
# File 'lib/rirc.rb', line 95 def chans return @chan_list end |
#cleanup ⇒ Object
111 112 113 |
# File 'lib/rirc.rb', line 111 def cleanup return "" end |
#file_name ⇒ Object
103 104 105 |
# File 'lib/rirc.rb', line 103 def file_name return @file_name end |
#help ⇒ Object
107 108 109 |
# File 'lib/rirc.rb', line 107 def help return @help end |
#name ⇒ Object
99 100 101 |
# File 'lib/rirc.rb', line 99 def name return @name end |
#regex ⇒ Object
91 92 93 |
# File 'lib/rirc.rb', line 91 def regex return @regexp end |
#rm_chan(channel) ⇒ Object
115 116 117 |
# File 'lib/rirc.rb', line 115 def rm_chan(channel) @chan_list.delete_if { |a| channel == a } end |
#script(message, nick, chan) ⇒ Object
default function
87 88 89 |
# File 'lib/rirc.rb', line 87 def script(, nick, chan) end |