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.
37 38 39 40 |
# File 'lib/net/irc.rb', line 37 def extract _, *ret = *self.match(/\A([^\s!]+)(?:!([^\s@]+)@(\S+))?\z/) ret end |
#host ⇒ Object
32 33 34 |
# File 'lib/net/irc.rb', line 32 def host extract[2] end |
#nick ⇒ Object
24 25 26 |
# File 'lib/net/irc.rb', line 24 def nick extract[0] end |
#user ⇒ Object
28 29 30 |
# File 'lib/net/irc.rb', line 28 def user extract[1] end |