Class: Redom::Connection::Sender
- Inherits:
-
Object
- Object
- Redom::Connection::Sender
- Defined in:
- lib/redom/connection.rb
Instance Method Summary collapse
-
#initialize(conn, async = false) ⇒ Sender
constructor
A new instance of Sender.
- #method_missing(name, *args, &blck) ⇒ Object
Constructor Details
#initialize(conn, async = false) ⇒ Sender
Returns a new instance of Sender.
6 7 8 9 |
# File 'lib/redom/connection.rb', line 6 def initialize(conn, async = false) @conn = conn @async = async end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &blck) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/redom/connection.rb', line 11 def method_missing(name, *args, &blck) if @async @conn._dispatcher.run_task(@conn, name, args, blck) nil else result = @conn.send(name, *args, &blck) @conn.sync{} result end end |