Sha256: 7aa89c1684a1328abcba058a7054c3b117991034cc51273037c15a939eec1b70

Contents?: true

Size: 355 Bytes

Versions: 6

Compression:

Stored size: 355 Bytes

Contents

require 'base64'

module Jets::Job::Helpers
  module KinesisEvent
    def kinesis_data
      records = event["Records"]
      records.map do |record|
        encoded = record["kinesis"]["data"]
        Base64.decode64(encoded) # data
      end
    end

    def kinesis_data?
      event["Records"]&.any? { |r| r.dig("kinesis", "data") }
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
jets-5.0.13 lib/jets/job/helpers/kinesis_event.rb
jets-5.0.12 lib/jets/job/helpers/kinesis_event.rb
jets-5.0.11 lib/jets/job/helpers/kinesis_event.rb
jets-5.0.10 lib/jets/job/helpers/kinesis_event.rb
jets-5.0.9 lib/jets/job/helpers/kinesis_event.rb
jets-5.0.8 lib/jets/job/helpers/kinesis_event.rb