Attributes
- mode_parser [R]
Public Class methods
# File lib/net/irc/message/serverconfig.rb, line 4 4: def initialize 5: @config = {} 6: @mode_parser = Net::IRC::Message::ModeParser.new 7: end
Public Instance methods
# File lib/net/irc/message/serverconfig.rb, line 27
27: def [](key)
28: @config[key]
29: end
# File lib/net/irc/message/serverconfig.rb, line 9
9: def set(arg)
10: params = arg.kind_of?(Net::IRC::Message) ? arg.to_a : arg.split(/\s+/)
11:
12: params[1..-1].each do |s|
13: case s
14: when /^:?are supported by this server$/
15: # Ignore
16: when /^([^=]+)=(.*)$/
17: key = Regexp.last_match[1].to_sym
18: value = Regexp.last_match[2]
19: @config[key] = value
20: @mode_parser.set(key, value) if key == :CHANMODES || key == :PREFIX
21: else
22: @config[s] = true
23: end
24: end
25: end