Sha256: fab7ca5123ad9151cce14f8aa9f2905812f3bfc13814cf7feae66cf830fc94a8

Contents?: true

Size: 572 Bytes

Versions: 2

Compression:

Stored size: 572 Bytes

Contents

class IRC
  class Connection < EventMachine::Connection
    include EventMachine::Protocols::LineText2

    def initialize(server)
      @server = server
    end

    ## EventMachine callbacks
    def post_init
      send_data("USER #{@server.ident || @server.irc.ident} * * #{@server.realname || @server.irc.realname}\r\n")
      send_data("NICK #{@server.nick || @server.irc.nick}\r\n")
    rescue => e
      p e
    end

    def receive_line(line)
      @server.receive_line(line.force_encoding('utf-8'))
    end

    def unbind
      @server.unbind
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
on_irc-2.1.1 lib/on_irc/connection.rb
on_irc-2.1.0 lib/on_irc/connection.rb