Class: IRCParser::Prefix
- Inherits:
-
Object
- Object
- IRCParser::Prefix
- Defined in:
- lib/ircparser/prefix.rb
Overview
Public: Represents the prefix of an IRC message.
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Public: The hostname of this prefix or nil if no hostname was given.
-
#nick ⇒ Object
readonly
Public: The nickname of this user.
-
#user ⇒ Object
readonly
Public: The username of this prefix or nil if no username was given.
Instance Method Summary collapse
-
#initialize(nick: nil, user: nil, host: nil) ⇒ Prefix
constructor
Public: Initialises a new message prefix.
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
#host ⇒ Object (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 |
#nick ⇒ Object (readonly)
Public: The nickname of this user.
25 26 27 |
# File 'lib/ircparser/prefix.rb', line 25 def nick @nick end |
#user ⇒ Object (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 |