X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=lib%2Frbot%2Fregistry.rb;h=4d52bff22e35d501764f73c8ef19fff0e4d75728;hb=7f9a979b04fbacda7343b1bcbda1ce83bfb31402;hp=4dfbdb35f8859f2ca3360eb29b54c7b0efebb162;hpb=1f0d0215fc076a921258d969b2022721ae05b71a;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/lib/rbot/registry.rb b/lib/rbot/registry.rb index 4dfbdb35..4d52bff2 100644 --- a/lib/rbot/registry.rb +++ b/lib/rbot/registry.rb @@ -220,25 +220,25 @@ class Bot end # just like Hash#each - def each(&block) + def each(set=nil, bulk=0, &block) return nil unless File.exist?(@filename) - registry.each {|key,value| + registry.each(set, bulk) {|key,value| block.call(key, restore(value)) } end # just like Hash#each_key - def each_key(&block) + def each_key(set=nil, bulk=0, &block) return nil unless File.exist?(@filename) - registry.each_key {|key| + registry.each_key(set, bulk) {|key| block.call(key) } end # just like Hash#each_value - def each_value(&block) + def each_value(set=nil, bulk=0, &block) return nil unless File.exist?(@filename) - registry.each_value { |value| + registry.each_value(set, bulk) { |value| block.call(restore(value)) } end