X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=lib%2Frbot%2Fjournal.rb;h=981ff6e47eaab41fa496ed929d614615772bd1e8;hb=69173fe810e61ede90f21d0fdd0b802c0607fc48;hp=9f586f7fc9a62c100ce19216a42a3064859db260;hpb=39503c481daf957c741db89767295a444973986d;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/lib/rbot/journal.rb b/lib/rbot/journal.rb index 9f586f7f..981ff6e4 100644 --- a/lib/rbot/journal.rb +++ b/lib/rbot/journal.rb @@ -78,7 +78,6 @@ module Journal def self.create(topic, payload, opt={}) # cleanup payload to only contain strings - payload = payload.map { |k, v| [k.to_s, v.to_s] }.to_h JournalMessage.new( id: opt[:id] || SecureRandom.uuid, timestamp: opt[:timestamp] || Time.now, @@ -99,7 +98,7 @@ module Journal end # creates/ensures a index exists on the payload specified by key - def ensure_index(key) + def ensure_payload_index(key) end # returns a array of message instances that match the query @@ -278,6 +277,7 @@ module Journal class JournalBroker + attr_reader :storage class Subscription attr_reader :topic attr_reader :block @@ -418,6 +418,10 @@ module Journal @storage.remove(query) end + def ensure_payload_index(key) + @storage.ensure_payload_index(key) + end + end end # Journal