Class: Sponge::IRC::User
- Inherits:
-
Object
- Object
- Sponge::IRC::User
- Defined in:
- lib/sponge/irc/user.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Our IRC::Client.
-
#host ⇒ Object
readonly
The hostname of this User.
-
#nick ⇒ Object
readonly
The nickname of this User.
-
#user ⇒ Object
readonly
The username of this User.
Instance Method Summary collapse
-
#initialize(client, nick, user, host) ⇒ User
constructor
A new instance of User.
-
#me? ⇒ Boolean
Check if the User is us.
- #to_s ⇒ Object
Constructor Details
#initialize(client, nick, user, host) ⇒ User
Returns a new instance of User.
17 18 19 20 21 22 |
# File 'lib/sponge/irc/user.rb', line 17 def initialize(client, nick, user, host) @client = client @nick = nick @user = user @host = host end |
Instance Attribute Details
#client ⇒ Object (readonly)
Our IRC::Client
6 7 8 |
# File 'lib/sponge/irc/user.rb', line 6 def client @client end |
#host ⇒ Object (readonly)
The hostname of this User
15 16 17 |
# File 'lib/sponge/irc/user.rb', line 15 def host @host end |
#nick ⇒ Object (readonly)
The nickname of this User
9 10 11 |
# File 'lib/sponge/irc/user.rb', line 9 def nick @nick end |
#user ⇒ Object (readonly)
The username of this User
12 13 14 |
# File 'lib/sponge/irc/user.rb', line 12 def user @user end |
Instance Method Details
#me? ⇒ Boolean
Check if the User is us
25 26 27 |
# File 'lib/sponge/irc/user.rb', line 25 def me? client.config.nickname == nick end |
#to_s ⇒ Object
29 30 31 |
# File 'lib/sponge/irc/user.rb', line 29 def to_s @nick end |