X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=lib%2Frbot%2Fjournal.rb;h=981ff6e47eaab41fa496ed929d614615772bd1e8;hb=a2eeb15faadf94c879d749e211d160cb86b659c6;hp=fe6c14be66802c2a93255d0e3c7d7772bcab7c04;hpb=c75c3db5b9dd918bb0372d41125993df2fe77374;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/lib/rbot/journal.rb b/lib/rbot/journal.rb index fe6c14be..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 @@ -419,6 +418,10 @@ module Journal @storage.remove(query) end + def ensure_payload_index(key) + @storage.ensure_payload_index(key) + end + end end # Journal