Class: Fairway::ChanneledConnection
- Inherits:
-
Object
- Object
- Fairway::ChanneledConnection
- Defined in:
- lib/fairway/channeled_connection.rb
Instance Method Summary collapse
- #deliver(message) ⇒ Object
-
#initialize(connection, &block) ⇒ ChanneledConnection
constructor
A new instance of ChanneledConnection.
- #method_missing(method, *args, &block) ⇒ Object
Constructor Details
#initialize(connection, &block) ⇒ ChanneledConnection
Returns a new instance of ChanneledConnection.
3 4 5 6 |
# File 'lib/fairway/channeled_connection.rb', line 3 def initialize(connection, &block) @connection = connection @block = block end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
13 14 15 |
# File 'lib/fairway/channeled_connection.rb', line 13 def method_missing(method, *args, &block) @connection.respond_to?(method) ? @connection.send(method, *args, &block) : super end |
Instance Method Details
#deliver(message) ⇒ Object
8 9 10 11 |
# File 'lib/fairway/channeled_connection.rb', line 8 def deliver() channel = @block.call() @connection.deliver(, channel) end |