Class: IRC::User
- Inherits:
-
Object
- Object
- IRC::User
- Defined in:
- lib/wires/ircbot/user.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#nick ⇒ Object
Returns the value of attribute nick.
-
#string ⇒ Object
Returns the value of attribute string.
-
#user ⇒ Object
Returns the value of attribute user.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(*args) ⇒ User
constructor
A new instance of User.
- #to_s ⇒ Object
Constructor Details
#initialize(*args) ⇒ User
Returns a new instance of User.
11 12 13 |
# File 'lib/wires/ircbot/user.rb', line 11 def initialize(*args) @string, @nick, @user, @host = *args end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
5 6 7 |
# File 'lib/wires/ircbot/user.rb', line 5 def host @host end |
#nick ⇒ Object
Returns the value of attribute nick.
5 6 7 |
# File 'lib/wires/ircbot/user.rb', line 5 def nick @nick end |
#string ⇒ Object
Returns the value of attribute string.
5 6 7 |
# File 'lib/wires/ircbot/user.rb', line 5 def string @string end |
#user ⇒ Object
Returns the value of attribute user.
5 6 7 |
# File 'lib/wires/ircbot/user.rb', line 5 def user @user end |
Class Method Details
.new(str) ⇒ Object
7 8 9 |
# File 'lib/wires/ircbot/user.rb', line 7 def self.new(str) (m = str.match /^(.+?)(?:(?:!(.+?))?@(.+?))?$/) ? super(*m.to_a) : nil end |
Instance Method Details
#to_s ⇒ Object
15 |
# File 'lib/wires/ircbot/user.rb', line 15 def to_s; @string; end |