Class: Alf::Adapter::Connection::SchemaCached

Inherits:
Alf::Adapter::Connection show all
Defined in:
lib/alf/adapter/connection/schema_cached.rb

Instance Attribute Summary

Attributes inherited from Alf::Adapter::Connection

#conn_spec

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Alf::Adapter::Connection

#close, #closed?, #cog, #delete, #heading, #in_transaction, #insert, #keys, #knows?, #lock, #migrate!, #update

Constructor Details

#initialize(connection, cache = nil) ⇒ SchemaCached


10
11
12
13
# File 'lib/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_cacheObject


6
7
8
# File 'lib/alf/adapter/connection/schema_cached.rb', line 6

def self.empty_cache
  Hash.new{|h,k| h[k] = {}}
end

Instance Method Details

#to_sObject


27
28
29
# File 'lib/alf/adapter/connection/schema_cached.rb', line 27

def to_s
  "#{@connection.to_s} (with cache)"
end