Class: Flamethrower::Dispatcher
- Inherits:
-
Object
- Object
- Flamethrower::Dispatcher
- Defined in:
- lib/flamethrower/dispatcher.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
Instance Method Summary collapse
- #handle_message(message) ⇒ Object
-
#initialize(connection) ⇒ Dispatcher
constructor
A new instance of Dispatcher.
Constructor Details
#initialize(connection) ⇒ Dispatcher
Returns a new instance of Dispatcher.
5 6 7 |
# File 'lib/flamethrower/dispatcher.rb', line 5 def initialize(connection) @connection = connection end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
3 4 5 |
# File 'lib/flamethrower/dispatcher.rb', line 3 def connection @connection end |
Instance Method Details
#handle_message(message) ⇒ Object
9 10 11 12 |
# File 'lib/flamethrower/dispatcher.rb', line 9 def () method = "handle_#{.command.downcase}" send(method, ) if protected_methods.map(&:to_s).include?(method) end |