Module: Jets::Event::Helpers::SnsEvent
- Included in:
- Base
- Defined in:
- lib/jets/event/helpers/sns_event.rb
Instance Method Summary collapse
Instance Method Details
#sns_events ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'lib/jets/event/helpers/sns_event.rb', line 3 def sns_events records = event["Records"] return [] unless records records.map do |record| = record["Sns"]["Message"] ActiveSupport::HashWithIndifferentAccess.new(JSON.load()) end end |
#sns_events? ⇒ Boolean
12 13 14 |
# File 'lib/jets/event/helpers/sns_event.rb', line 12 def sns_events? event["Records"]&.any? { |r| r.dig("Sns", "Message") } end |