Class: Woods::Console::SafeContext::SingleConnectionPool Private
- Inherits:
-
Struct
- Object
- Struct
- Woods::Console::SafeContext::SingleConnectionPool
- Defined in:
- lib/woods/console/safe_context.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Thin adapter that makes a bare connection look like a connection pool with a ‘with_connection` interface. Used internally when callers pass `connection:` so that #execute always flows through a single code path regardless of construction form.
Instance Attribute Summary collapse
-
#connection ⇒ Object
Returns the value of attribute connection.
Instance Method Summary collapse
Instance Attribute Details
#connection ⇒ Object
Returns the value of attribute connection
102 103 104 |
# File 'lib/woods/console/safe_context.rb', line 102 def connection @connection end |
Instance Method Details
#with_connection {|Object| ... } ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
104 105 106 |
# File 'lib/woods/console/safe_context.rb', line 104 def with_connection(&block) block.call(connection) end |