Class: IRC::Connection
- Inherits:
-
EventMachine::Connection
- Object
- EventMachine::Connection
- IRC::Connection
- Includes:
- EventMachine::Protocols::LineText2
- Defined in:
- lib/on_irc/connection.rb
Instance Method Summary collapse
-
#initialize(server) ⇒ Connection
constructor
A new instance of Connection.
-
#post_init ⇒ Object
EventMachine callbacks.
- #receive_line(line) ⇒ Object
- #unbind ⇒ Object
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_init ⇒ Object
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 |
#unbind ⇒ Object
21 22 23 |
# File 'lib/on_irc/connection.rb', line 21 def unbind @server.unbind end |