Class: Net::IRC::Message::ServerConfig

### Home Classes Methods

### In Files

- lib/net/irc/message/serverconfig.rb

### Parent

Object

### Methods

- ::new
- #[]
- #set

### Files

- README

### Class/Module Index

Quicksearch

- Net
- Net::IRC
- Net::IRC::Client
- Net::IRC::Client::ChannelManager
- Net::IRC::IRCException
- Net::IRC::Message
- Net::IRC::Message::InvalidMessage
- Net::IRC::Message::ModeParser
- Net::IRC::Message::ServerConfig
- Net::IRC::Prefix
- Net::IRC::Server
- Net::IRC::Server::Session
- Object

No matching classes.

# Net::IRC::Message::ServerConfig

### Attributes

mode_parser[R]

### Public Class Methods

new() click to toggle source

    # File lib/net/irc/message/serverconfig.rb, line 4
    def initialize
            @config = {}
            @mode_parser = Net::IRC::Message::ModeParser.new
    end

### Public Instance Methods

[](key) click to toggle source

    # File lib/net/irc/message/serverconfig.rb, line 27
    def [](key)
            @config[key]
    end

set(arg) click to toggle source

    # File lib/net/irc/message/serverconfig.rb, line 9
    def set(arg)
            params = arg.kind_of?(Net::IRC::Message) ? arg.to_a : arg.split(" ")

            params[1..-1].each do |s|
                    case s
                    when /\A:?are supported by this server\z/
                            # Ignore
                    when /\A([^=]+)=(.*)\z/
                            key = Regexp.last_match[1].to_sym
                            value = Regexp.last_match[2]
                            @config[key] = value
                            @mode_parser.set(key, value) if key == :CHANMODES || key == :PREFIX
                    else
                            @config[s] = true
                    end
            end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.