Class: ActiveRecord::ConnectionAdapters::ConnectionPool::Lease
- Inherits:
-
Object
- Object
- ActiveRecord::ConnectionAdapters::ConnectionPool::Lease
- Defined in:
- lib/active_record/connection_adapters/abstract/connection_pool.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#connection ⇒ Object
Returns the value of attribute connection.
-
#sticky ⇒ Object
Returns the value of attribute sticky.
Instance Method Summary collapse
- #clear(connection) ⇒ Object
-
#initialize ⇒ Lease
constructor
A new instance of Lease.
- #release ⇒ Object
Constructor Details
#initialize ⇒ Lease
Returns a new instance of Lease.
144 145 146 147 |
# File 'lib/active_record/connection_adapters/abstract/connection_pool.rb', line 144 def initialize @connection = nil @sticky = nil end |
Instance Attribute Details
#connection ⇒ Object
Returns the value of attribute connection.
142 143 144 |
# File 'lib/active_record/connection_adapters/abstract/connection_pool.rb', line 142 def connection @connection end |
#sticky ⇒ Object
Returns the value of attribute sticky.
142 143 144 |
# File 'lib/active_record/connection_adapters/abstract/connection_pool.rb', line 142 def sticky @sticky end |
Instance Method Details
#clear(connection) ⇒ Object
156 157 158 159 160 161 162 163 164 |
# File 'lib/active_record/connection_adapters/abstract/connection_pool.rb', line 156 def clear(connection) if @connection == connection @connection = nil @sticky = nil true else false end end |
#release ⇒ Object
149 150 151 152 153 154 |
# File 'lib/active_record/connection_adapters/abstract/connection_pool.rb', line 149 def release conn = @connection @connection = nil @sticky = nil conn end |