lib/rising_dragon/sqs/emitter.rb in rising_dragon-0.3.4 vs lib/rising_dragon/sqs/emitter.rb in rising_dragon-0.4.0
- old
+ new
@@ -42,22 +42,22 @@
handler.new.handle(event)
nil
end
- def event_from_json(body)
- msg = JSON.parse(body["Message"])
+ def event_from_json(sqs_msg, body)
+ msg = JSON.parse(body['Message'])
- id = msg["id"]
- type = msg["type"]
- timestamp = Time.at(msg["timestamp"] / 1000.0)
- data = msg["data"]
+ id = msg['id']
+ type = msg['type']
+ timestamp = Time.at(msg['timestamp'] / 1000.0)
+ data = msg['data']
- ::RisingDragon::Event.new(id: id, type: type, timestamp: timestamp, data: data)
+ ::RisingDragon::Event.new(id: id, type: type, timestamp: timestamp, data: data, sqs_msg: sqs_msg)
end
- def emit_sns_msg(body)
- event = event_from_json(body)
+ def emit_sqs_msg(sqs_msg, body)
+ event = event_from_json(sqs_msg, body)
emit_event(event)
end
end
end
end