Module: IIRC::IRCv3::Parsing

Included in:
IIRC::IRCv3Bot
Defined in:
lib/iirc/modules/ircv3/parsing.rb

Instance Method Summary collapse

Instance Method Details

#parse(line) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/iirc/modules/ircv3/parsing.rb', line 6

def parse(line)
  msg = IRCParser::Message.parse(line.tr("\r", '').chomp)

  Event.new.tap { |evt|
    evt.sender = IRCParser::RFCWireFormat.__stringify_prefix(msg.prefix) if msg.prefix
    evt.tags = msg.tags
    evt.verb = msg.command.downcase.to_sym
    evt.args = msg.parameters
  }
end