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.
124 125 126 127 |
# File 'lib/active_record/connection_adapters/abstract/connection_pool.rb', line 124 def initialize @connection = nil @sticky = nil end |
Instance Attribute Details
#connection ⇒ Object
Returns the value of attribute connection.
122 123 124 |
# File 'lib/active_record/connection_adapters/abstract/connection_pool.rb', line 122 def connection @connection end |
#sticky ⇒ Object
Returns the value of attribute sticky.
122 123 124 |
# File 'lib/active_record/connection_adapters/abstract/connection_pool.rb', line 122 def sticky @sticky end |
Instance Method Details
#clear(connection) ⇒ Object
136 137 138 139 140 141 142 143 144 |
# File 'lib/active_record/connection_adapters/abstract/connection_pool.rb', line 136 def clear(connection) if @connection == connection @connection = nil @sticky = nil true else false end end |
#release ⇒ Object
129 130 131 132 133 134 |
# File 'lib/active_record/connection_adapters/abstract/connection_pool.rb', line 129 def release conn = @connection @connection = nil @sticky = nil conn end |