Class: Net::IRC::Prefix

Inherits:
String
  • Object
show all
Defined in:
lib/net/irc.rb

Instance Method Summary collapse

Instance Method Details

#extractObject

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

#hostObject



30
31
32
# File 'lib/net/irc.rb', line 30

def host
	extract[2]
end

#nickObject



22
23
24
# File 'lib/net/irc.rb', line 22

def nick
	extract[0]
end

#userObject



26
27
28
# File 'lib/net/irc.rb', line 26

def user
	extract[1]
end