Class: Krtek::Irc::Handler
- Inherits:
-
EM::Connection
- Object
- EM::Connection
- Krtek::Irc::Handler
- Extended by:
- Forwardable
- Defined in:
- lib/krtek/handler.rb
Instance Method Summary collapse
- #connection_completed ⇒ Object
-
#initialize(opts = {}) ⇒ Handler
constructor
A new instance of Handler.
- #post_init ⇒ Object
- #send_data(data) ⇒ Object
- #ssl_handshake_completed ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Handler
Returns a new instance of Handler.
9 10 11 12 13 |
# File 'lib/krtek/handler.rb', line 9 def initialize(opts = {}) raise ArgumentError, "missing :client parameter for EM#connect" unless opts[:client] @client = opts[:client] @ssl = opts[:ssl] || false end |
Instance Method Details
#connection_completed ⇒ Object
23 24 25 |
# File 'lib/krtek/handler.rb', line 23 def connection_completed @ssl ? start_tls : @client.ready end |
#post_init ⇒ Object
19 20 21 |
# File 'lib/krtek/handler.rb', line 19 def post_init @client.connection = self end |
#send_data(data) ⇒ Object
15 16 17 |
# File 'lib/krtek/handler.rb', line 15 def send_data(data) super end |
#ssl_handshake_completed ⇒ Object
27 28 29 |
# File 'lib/krtek/handler.rb', line 27 def ssl_handshake_completed @client.ready if @client.ssl end |