Class: Net::IRC::Prefix
- Inherits:
-
String
- Object
- String
- Net::IRC::Prefix
- Defined in:
- lib/net/irc.rb
Instance Method Summary collapse
-
#extract ⇒ Object
Extract Prefix String to [nick, user, host] Array.
- #host ⇒ Object
- #nick ⇒ Object
- #user ⇒ Object
Instance Method Details
#extract ⇒ Object
Extract Prefix String to [nick, user, host] Array.
38 39 40 41 |
# File 'lib/net/irc.rb', line 38 def extract _, *ret = *self.match(/\A([^\s!]+)(?:!([^\s@]+)@(\S+))?\z/) ret end |
#host ⇒ Object
33 34 35 |
# File 'lib/net/irc.rb', line 33 def host extract[2] end |
#nick ⇒ Object
25 26 27 |
# File 'lib/net/irc.rb', line 25 def nick extract[0] end |
#user ⇒ Object
29 30 31 |
# File 'lib/net/irc.rb', line 29 def user extract[1] end |