summaryrefslogtreecommitdiff
path: root/lib/rbot
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2009-02-22 01:45:37 +0100
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2009-02-22 01:58:05 +0100
commitb9a51549e71790fcb801828b19d7de925ff94fad (patch)
treef55bd977c0d96cf62ef4a21c810bca39b97727f5 /lib/rbot
parent1f0d0215fc076a921258d969b2022721ae05b71a (diff)
registry: expose set and bulk parameters
expose set and bulk parameters in the each*() iterators. Some plugins might need it for faster lookup.
Diffstat (limited to 'lib/rbot')
-rw-r--r--lib/rbot/registry.rb12
1 files changed, 6 insertions, 6 deletions
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