diff options
Diffstat (limited to 'lib/rbot/journal.rb')
-rw-r--r-- | lib/rbot/journal.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/rbot/journal.rb b/lib/rbot/journal.rb index 27565d06..cc0578de 100644 --- a/lib/rbot/journal.rb +++ b/lib/rbot/journal.rb @@ -75,10 +75,14 @@ module Journal end end - def self.create(topic, payload) + def ==(other) + @id == other.id + end + + def self.create(topic, payload, opt={}) JournalMessage.new( - id: SecureRandom.uuid, - timestamp: Time.now, + id: opt[:id] || SecureRandom.uuid, + timestamp: opt[:timestamp] || Time.now, topic: topic, payload: payload ) |