struct FastIRC::Prefix

Overview

Prefix of the IRC message (nick!user@host).

IRC Prefixes can either consist of a nickname with optional user and host, or a server hostname. To handle both these cases, #source is set to either the nick or server name depending on which type of prefix is received. This means #source is always present.

Defined in:

fast_irc/message.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(*, source : String, user : Nil | String, host : Nil | String) #

[View source]

Instance Method Detail

def host : String | Nil #

[View source]
def inspect(io) #

[View source]
def server? #

Returns true if the source of this prefix an IRC server.

The check used for the is if the source contains a '.' character.


[View source]
def source : String #

[View source]
def to_s(io) #

Converts the prefix back into a raw IRC prefix (e.g. nick!user@host). Does not include leading ':'.


[View source]
def user : String | Nil #

[View source]
def user? #

Returns true if the source of this prefix an IRC server.

The same as !server?.


[View source]