struct FastIRC::Prefix

Included Modules

Defined in:

fast_irc/message.cr
fast_irc/parser.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(str : Slice(UInt8), target_start : Int32 | Nil, target_length : Int32 | Nil, user_start : Int32 | Nil, user_length : Int32 | Nil, host_start : Int32 | Nil, host_length : Int32 | Nil) #

Initialises the Prefix with a backing Slice(UInt8) of bytes, and the locations of strings inside the slice. Use this method only if you know what you are doing.


[View source]
def self.new(target : Nil | String, user : Nil | String = nil, host : Nil | String = nil) #

Initialises the Prefix with the given target, user and host strings.


[View source]

Class Method Detail

def self.parse(str : Slice(UInt8)) #

Parses an IRC Prefix from a Slice(UInt8). The slice should not have trailing \r\n characters and should be null terminated.


[View source]
def self.parse(str) #

Parses an IRC Prefix from a String. The String should not have the trailing "\r\n" characters.


[View source]

Instance Method Detail

def ==(other : self) #

[View source]
def host #

[View source]
def host? #

[View source]
def inspect(io) #

[View source]
def target #

[View source]
def target? #

[View source]
def to_s(io) #

Converts the prefix back into an IRC format string. (e.g. "nick!user@host" )


[View source]
def user #

[View source]
def user? #

[View source]