Module: Balotelli::Core::Utils

Defined in:
lib/balotelli/core/utils.rb

Defined Under Namespace

Modules: ClassVariableGetter

Constant Summary collapse

NICK_REGEX =
/\A(\S+)!.*/
PRIV_MSG_REGEX =
/\A:?(\S+) PRIVMSG (\S+) :?(.*)/
JOIN_REGEX =
/\A:?(\S+) JOIN (\S+)/

Class Method Summary collapse

Class Method Details

.nick_from_user(str) ⇒ Object



10
11
12
# File 'lib/balotelli/core/utils.rb', line 10

def nick_from_user(str)
  str.match(NICK_REGEX)[1]
end

.table_regex(nick) ⇒ Object



14
15
16
# File 'lib/balotelli/core/utils.rb', line 14

def table_regex(nick)
  /\A:?(\S+) \d+ #{nick} \S (#\S+) :?(.*)/
end