Class | Irc::Server
In: | lib/rbot/irc.rb
Parent: | Object

An IRC Server represents the Server the client is connected to.

### Methods

casemap channel channel_names clear delete_channel delete_user delete_user_from_channel find_users get_chan get_channel get_user has_chan? has_channel? has_user? inspect mode_for_prefix new new_channel new_netmask new_user parse_isupport parse_my_info prefix_for_mode reset_capabilities reset_lists user user_nicks user_or_channel user_or_channel?

### External Aliases

hostname | -> | to_s

### Attributes

capabilities | [R] |
chanmodes | [R] |
channels | [R] |
hostname | [R] |
supports | [R] |
usermodes | [R] |
users | [R] |
version | [R] |

### Public Class methods

new()

Create a new Server, with all instance variables reset to nil (for scalar variables), empty channel and user lists and @supports initialized to the default values for all known supported features.

### Public Instance methods

casemap()

Returns the casemap of the server.

channel(str)

Returns the Channel with the given name on the server, creating it if necessary. This is a short form for new_channel(str, nil, [], `false`)

channel_names()

TODO Ho

clear()

Clears the server

delete_channel(name)

Remove Channel name from the list of `Channel`s

delete_user(someuser)

Remove User someuser from the list of `User`s. someuser must be specified with the full Netmask.

delete_user_from_channel(user, channel)

Deletes User user from Channel channel

find_users(mask)

Finds all `User`s on server whose Netmask matches mask

get_chan(name)

Alias for get_channel

get_channel(name)

Returns the channel with name name, if available

get_user(nick)

Returns the user with nick nick, if available

has_chan?(name)

Alias for has_channel?

has_channel?(name)

Checks if the receiver already has a channel with the given name

has_user?(nick)

Checks if the receiver already has a user with the given nick

inspect()
mode_for_prefix(pfx)

Convert a prefix (@, +, %, …) to the corresponding mode (o, v, h, …). See also prefix_for_mode

new_channel(name, topic=nil, users=[], fails=true)

Create a new Channel object bound to the receiver and add it to the list of `Channel`s on the receiver, unless the channel was present already. In this case, the default action is to raise an exception, unless fails is set to false. An exception can also be raised if str is nil or empty, again only if fails is set to true; otherwise, the method just returns nil

new_netmask(str)

Create a new Netmask object with the appropriate casemap

new_user(str, fails=true)

Create a new User object bound to the receiver and add it to the list of `User`s on the receiver, unless the User was present already. In this case, the default action is to raise an exception, unless fails is set to false. An exception can also be raised if str is nil or empty, again only if fails is set to true; otherwise, the method just returns nil

parse_isupport(line)

This method is used to parse a 005 RPL_ISUPPORT line

See the RPL_ISUPPORT draft

parse_my_info(line)

This method is used to parse a 004 RPL_MY_INFO line

prefix_for_mode(mode)

Convert a mode (o, v, h, …) to the corresponding prefix (@, +, %, …). See also mode_for_prefix

reset_capabilities()

Resets the server capabilities

reset_lists()

Resets the Channel and User list

user(str)

Returns the User with the given Netmask on the server, creating it if necessary. This is a short form for new_user(str, `false`)

user_nicks()

TODO Ho

user_or_channel(name)

Returns the actual User or Channel object matching name

user_or_channel?(name)

Returns User or Channel depending on what name can be a name of

[Validate]