Class: ActiveRecordHostPool::ConnectionProxy
- Inherits:
-
Delegator
- Object
- Delegator
- ActiveRecordHostPool::ConnectionProxy
- Defined in:
- lib/active_record_host_pool/connection_proxy.rb
Instance Method Summary collapse
- #__getobj__ ⇒ Object
- #__setobj__(cx) ⇒ Object
-
#class ⇒ Object
this is bad.
- #expects(*args) ⇒ Object
-
#initialize(cx, database) ⇒ ConnectionProxy
constructor
A new instance of ConnectionProxy.
- #unproxied ⇒ Object
Constructor Details
#initialize(cx, database) ⇒ ConnectionProxy
Returns a new instance of ConnectionProxy.
7 8 9 10 11 |
# File 'lib/active_record_host_pool/connection_proxy.rb', line 7 def initialize(cx, database) super(cx) @cx = cx @database = database end |
Instance Method Details
#__getobj__ ⇒ Object
13 14 15 16 |
# File 'lib/active_record_host_pool/connection_proxy.rb', line 13 def __getobj__ @cx._host_pool_current_database = @database @cx end |
#__setobj__(cx) ⇒ Object
18 19 20 |
# File 'lib/active_record_host_pool/connection_proxy.rb', line 18 def __setobj__(cx) @cx = cx end |
#class ⇒ Object
this is bad. I know. but it allows folks who class_eval on connection.class to do so
27 28 29 |
# File 'lib/active_record_host_pool/connection_proxy.rb', line 27 def class @cx.class end |
#expects(*args) ⇒ Object
31 32 33 |
# File 'lib/active_record_host_pool/connection_proxy.rb', line 31 def expects(*args) @cx.send(:expects, *args) end |
#unproxied ⇒ Object
22 23 24 |
# File 'lib/active_record_host_pool/connection_proxy.rb', line 22 def unproxied @cx end |