Class: EventMachine::IRC::Dispatcher
- Inherits:
-
Connection
- Object
- Connection
- EventMachine::IRC::Dispatcher
- Extended by:
- Forwardable
- Defined in:
- lib/em-irc/dispatcher.rb
Overview
EventMachine connection handler class that dispatches connections back to another object.
Instance Method Summary collapse
- #connection_completed ⇒ Object
-
#initialize(options) ⇒ Dispatcher
constructor
A new instance of Dispatcher.
- #post_init ⇒ Object
- #ssl_handshake_completed ⇒ Object
Constructor Details
#initialize(options) ⇒ Dispatcher
Returns a new instance of Dispatcher.
8 9 10 11 12 13 |
# File 'lib/em-irc/dispatcher.rb', line 8 def initialize() raise ArgumentError.new(":parent parameter is required for EM#connect") unless [:parent] # TODO: if parent doesn't respond to a above methods, do a no-op @parent = [:parent] @ssl = [:ssl] || false end |
Instance Method Details
#connection_completed ⇒ Object
20 21 22 |
# File 'lib/em-irc/dispatcher.rb', line 20 def connection_completed @ssl ? start_tls : @parent.ready end |
#post_init ⇒ Object
16 17 18 |
# File 'lib/em-irc/dispatcher.rb', line 16 def post_init @parent.conn = self end |
#ssl_handshake_completed ⇒ Object
24 25 26 |
# File 'lib/em-irc/dispatcher.rb', line 24 def ssl_handshake_completed @parent.ready if @parent.ssl end |