lib/rising_dragon/event.rb in rising_dragon-0.3.4 vs lib/rising_dragon/event.rb in rising_dragon-0.4.0
- old
+ new
@@ -1,20 +1,25 @@
module RisingDragon
class Event
attr_reader :id, :type, :timestamp, :data
- def initialize(id:, type:, timestamp:, data:)
+ def initialize(id:, type:, timestamp:, data:, sqs_msg:)
@id = id
@type = type
@timestamp = timestamp
@data = data
+ @sqs_msg = sqs_msg
end
def to_json(*option)
{
id: @id,
type: @type,
timestamp: @timestamp,
data: @data,
}.to_json(*option)
+ end
+
+ def delete!
+ @sqs_msg.delete
end
end
end