/[pupa]/ruby-cache/lib/cache.rb
ViewVC logotype

Diff of /ruby-cache/lib/cache.rb

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by okuji, Sat Nov 16 22:38:21 2002 UTC revision 1.4 by okuji, Sat Nov 16 22:55:42 2002 UTC
# Line 15  class Cache Line 15  class Cache
15    end    end
16        
17    def initialize(max_obj_size = nil, max_size = nil, max_num = nil,    def initialize(max_obj_size = nil, max_size = nil, max_num = nil,
18                   expiration = nil, hook = nil)                   expiration = nil, hook = nil, &proc)
19      if max_obj_size and max_size and max_obj_size > max_size      if max_obj_size and max_size and max_obj_size > max_size
20        raise ArgumentError, "max_obj_size exceeds max_size (#{max_obj_size} > #{max_size})"        raise ArgumentError, "max_obj_size exceeds max_size (#{max_obj_size} > #{max_size})"
21      end      end
# Line 36  class Cache Line 36  class Cache
36      @max_size = max_size      @max_size = max_size
37      @max_num = max_num      @max_num = max_num
38      @expiration = expiration      @expiration = expiration
39      @hook = hook      @hook = hook || proc
40            
41      @objs = {}      @objs = {}
42      @size = 0      @size = 0

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26