Cache#each -> AVCH#each_keys

master
Denis Knauf 2010-03-30 11:43:59 +02:00
parent 694d2a22fa
commit 3fa3ac495d
1 changed files with 11 additions and 2 deletions

View File

@ -46,9 +46,10 @@ class LogAn::Cache
end
include Enumerable
def each
def each *paras
return Enumerator.new self, :each unless block_given?
(@source.keys + @data.keys).each do |key|
flush! if @type&2 == 2
@source.each_keys( *paras) do |key|
yield key, self[key]
end
self
@ -74,8 +75,16 @@ class LogAn::AutoValueConvertHash
end
def each *paras
return Enumerator.new self, :each unless block_given?
@each.call *paras do |k, v|
yield k, @decode.call( v)
end
end
def each_keys *paras
return Enumerator.new self, :each_keys unless block_given?
@each.call *paras do |k, v|
yield k
end
end
end