Class: Alf::Adapter::Connection::SchemaCached
- Inherits:
-
Alf::Adapter::Connection
- Object
- Alf::Adapter::Connection
- Alf::Adapter::Connection::SchemaCached
- Defined in:
- lib/alf-adapter/alf/adapter/connection/schema_cached.rb
Instance Attribute Summary
Attributes inherited from Alf::Adapter::Connection
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(connection, cache = nil) ⇒ SchemaCached
constructor
A new instance of SchemaCached.
- #to_s ⇒ Object
Methods inherited from Alf::Adapter::Connection
#close, #closed?, #cog, #compiler, #delete, #heading, #in_transaction, #insert, #keys, #knows?, #lock, #migrate!, #update
Constructor Details
#initialize(connection, cache = nil) ⇒ SchemaCached
Returns a new instance of SchemaCached.
10 11 12 13 |
# File 'lib/alf-adapter/alf/adapter/connection/schema_cached.rb', line 10 def initialize(connection, cache = nil) @connection = connection @cache = cache || SchemaCached.empty_cache end |
Class Method Details
.empty_cache ⇒ Object
6 7 8 |
# File 'lib/alf-adapter/alf/adapter/connection/schema_cached.rb', line 6 def self.empty_cache Hash.new{|h,k| h[k] = {}} end |
Instance Method Details
#to_s ⇒ Object
27 28 29 |
# File 'lib/alf-adapter/alf/adapter/connection/schema_cached.rb', line 27 def to_s "#{@connection.to_s} (with cache)" end |