File: tmstd/cache.rb

Overview
Module Structure
Class Hierarchy
Code

Overview

Module Structure

  module: <Toplevel Module>
  module: TmStd#6
  module: Cache#8
  class: AbstractEntry#10
inherits from
  Abstract ( TmStd::Lsm::Collection::Map )
  class: AbstractManager#14
inherits from
  Abstract ( TmStd::Lsm::Collection::Map )
has properties
constant: LSM_DOMAIN_CLASS #15
constant: LSM_RANGE_CLASS #16
method: method_missing / 2 #19

Code

   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