Class: IRC::Connection

Inherits:
EventMachine::Connection
  • Object
show all
Includes:
EventMachine::Protocols::LineText2
Defined in:
lib/on_irc/connection.rb

Instance Method Summary collapse

Constructor Details

#initialize(server) ⇒ Connection

Returns a new instance of Connection.



5
6
7
# File 'lib/on_irc/connection.rb', line 5

def initialize(server)
  @server = server
end

Instance Method Details

#post_initObject

EventMachine callbacks



10
11
12
13
14
15
# File 'lib/on_irc/connection.rb', line 10

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

#receive_line(line) ⇒ Object



17
18
19
# File 'lib/on_irc/connection.rb', line 17

def receive_line(line)
  @server.receive_line(line)
end

#unbindObject



21
22
23
# File 'lib/on_irc/connection.rb', line 21

def unbind
  @server.unbind
end