Class: ActiveRecord::Turntable::PoolProxy
- Inherits:
-
Object
- Object
- ActiveRecord::Turntable::PoolProxy
- Defined in:
- lib/active_record/turntable/pool_proxy.rb
Instance Attribute Summary collapse
-
#proxy ⇒ Object
(also: #connection)
readonly
Returns the value of attribute proxy.
Instance Method Summary collapse
- #active_connection? ⇒ Boolean
- #discard! ⇒ Object
-
#initialize(proxy) ⇒ PoolProxy
constructor
A new instance of PoolProxy.
- #with_connection {|proxy| ... } ⇒ Object
Constructor Details
#initialize(proxy) ⇒ PoolProxy
Returns a new instance of PoolProxy.
3 4 5 |
# File 'lib/active_record/turntable/pool_proxy.rb', line 3 def initialize(proxy) @proxy = proxy end |
Instance Attribute Details
#proxy ⇒ Object (readonly) Also known as: connection
Returns the value of attribute proxy.
7 8 9 |
# File 'lib/active_record/turntable/pool_proxy.rb', line 7 def proxy @proxy end |
Instance Method Details
#active_connection? ⇒ Boolean
29 30 31 |
# File 'lib/active_record/turntable/pool_proxy.rb', line 29 def active_connection? connection_pools_list.any?(&:active_connection?) end |
#discard! ⇒ Object
59 60 61 |
# File 'lib/active_record/turntable/pool_proxy.rb', line 59 def discard! # Nothing to do end |
#with_connection {|proxy| ... } ⇒ Object
10 11 12 |
# File 'lib/active_record/turntable/pool_proxy.rb', line 10 def with_connection yield proxy end |