1 # $Id: cache.rb,v 1.1 2012/01/23 17:11:37 machan Exp $
2
3 require 'tmdoc/tmstd'
4
5
6 module TmStd
7
8 module Cache
9
10 class AbstractEntry < Lsm::Collection::Map::Abstract; end
11
12
13
14 class AbstractManager < Lsm::Collection::Map::Abstract
15 LSM_DOMAIN_CLASS = ::Symbol
16 LSM_RANGE_CLASS = AbstractEntry
17
18
19 def method_missing(member, *args)
20 Assertion.kind_of member, ::Symbol
21 Assertion.assert args.length == 0
22
23 entry = self.at member
24 unless entry
25 raise NameError, member.to_s
26 end
27
28 Assertion.kind_of entry, AbstractEntry
29 end
30 end
31
32 end # TmStd::Cache
33
34 end # TmStd