From 732f8df5966f4b85ffe19e045e9aeccc35206fab Mon Sep 17 00:00:00 2001 From: Matthias Hecker Date: Sat, 20 Jun 2015 20:39:39 +0200 Subject: journal: allow hash/proc for query in count and remove --- lib/rbot/journal.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib') diff --git a/lib/rbot/journal.rb b/lib/rbot/journal.rb index c5bfcfea..8d897929 100644 --- a/lib/rbot/journal.rb +++ b/lib/rbot/journal.rb @@ -344,6 +344,7 @@ module Journal def publish(topic, payload) @queue << JournalMessage::create(topic, payload) + nil end # Subscribe to receive messages from a topic. @@ -401,10 +402,16 @@ module Journal end def count(query=nil) + unless query.is_a? Query + query = Query.define(query) + end @storage.count(query) end def remove(query=nil) + unless query.is_a? Query + query = Query.define(query) + end @storage.remove(query) end -- cgit v1.2.3