summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatthias Hecker <apoc@geekosphere.org>2015-06-20 20:39:39 +0200
committerMatthias Hecker <apoc@geekosphere.org>2015-06-20 20:39:39 +0200
commit732f8df5966f4b85ffe19e045e9aeccc35206fab (patch)
treebb8b9c219d51680c713b86f4beca75ad047438d7 /lib
parent85bfb8405528b2da203291b5671f9077d5b62742 (diff)
journal: allow hash/proc for query in count and remove
Diffstat (limited to 'lib')
-rw-r--r--lib/rbot/journal.rb7
1 files changed, 7 insertions, 0 deletions
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