Sha256: 2e5917dca68f11cc9ef42fec97cd8cfa64c602d5145fb142c8546556fa900ec5

Contents?: true

Size: 296 Bytes

Versions: 10

Compression:

Stored size: 296 Bytes

Contents

module Lambdakiq
  module Event

    def jobs?(event)
      records(event).any? { |r| job?(r) }
    end

    def job?(record)
      record.dig('messageAttributes', 'lambdakiq', 'stringValue') == '1'
    end

    def records(event)
      event['Records'] || []
    end

    extend self

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
lambdakiq-2.3.0 lib/lambdakiq/event.rb
lambdakiq-2.2.0 lib/lambdakiq/event.rb
lambdakiq-2.1.0 lib/lambdakiq/event.rb
lambdakiq-2.0.2 lib/lambdakiq/event.rb
lambdakiq-2.0.1 lib/lambdakiq/event.rb
lambdakiq-2.0.0 lib/lambdakiq/event.rb
lambdakiq-1.0.4 lib/lambdakiq/event.rb
lambdakiq-1.0.3 lib/lambdakiq/event.rb
lambdakiq-1.0.2 lib/lambdakiq/event.rb
lambdakiq-1.0.1 lib/lambdakiq/event.rb