Class: IRCParser::Prefix

Inherits:
Object
  • Object
show all
Defined in:
lib/ircparser/prefix.rb

Overview

Public: Represents the prefix of an IRC message.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(nick: nil, user: nil, host: nil) ⇒ Prefix

Public: Initialises a new message prefix.

nick - The nickname of this user. user - The username of this prefix or nil if no username was given. host - The hostname of this prefix or nil if no hostname was given.



35
36
37
38
39
# File 'lib/ircparser/prefix.rb', line 35

def initialize nick: nil, user: nil, host: nil
	@nick = nick
	@user = user
	@host = host
end

Instance Attribute Details

#hostObject (readonly)

Public: The hostname of this prefix or nil if no hostname was given.



22
23
24
# File 'lib/ircparser/prefix.rb', line 22

def host
  @host
end

#nickObject (readonly)

Public: The nickname of this user.



25
26
27
# File 'lib/ircparser/prefix.rb', line 25

def nick
  @nick
end

#userObject (readonly)

Public: The username of this prefix or nil if no username was given.



28
29
30
# File 'lib/ircparser/prefix.rb', line 28

def user
  @user
end