Class: Yoda::Store::Adapters::LazyAdapter
- Inherits:
-
Base
- Object
- Base
- Yoda::Store::Adapters::LazyAdapter
show all
- Extended by:
- Forwardable
- Defined in:
- lib/yoda/store/adapters/lazy_adapter.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#batch_write, #clear, #delete, #empty?, #exist?, #get, #inspect, #keys, #namespace, #persistable?, #put, #stats, #sync
Constructor Details
Returns a new instance of LazyAdapter.
23
24
25
|
# File 'lib/yoda/store/adapters/lazy_adapter.rb', line 23
def initialize(path)
@path = path
end
|
Class Method Details
.for(path, type) ⇒ Object
8
9
10
11
|
# File 'lib/yoda/store/adapters/lazy_adapter.rb', line 8
def for(path, type)
@pool ||= {}
@pool[path] || (@pool[path] = new(path))
end
|
.type ⇒ Object
13
14
15
|
# File 'lib/yoda/store/adapters/lazy_adapter.rb', line 13
def type
:lazy
end
|
Instance Method Details
28
29
30
|
# File 'lib/yoda/store/adapters/lazy_adapter.rb', line 28
def adapter
@adapter ||= Adapters.for(path)
end
|