Module: Jets::Event::Helpers::SqsEvent
Instance Method Summary collapse
Instance Method Details
#sqs_events ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/jets/event/helpers/sqs_event.rb', line 10 def sqs_events records = sqs_records return [] unless records records.map do |record| JSON.parse(record[:body]) end end |
#sqs_events? ⇒ Boolean
19 20 21 |
# File 'lib/jets/event/helpers/sqs_event.rb', line 19 def sqs_events? sqs_records&.any? { |r| r.dig(:body) } end |
#sqs_records ⇒ Object
5 6 7 |
# File 'lib/jets/event/helpers/sqs_event.rb', line 5 def sqs_records event[:Records].map { |record| record } end |