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