Module: Jets::Event::Helpers::KinesisEvent

Included in:
Base
Defined in:
lib/jets/event/helpers/kinesis_event.rb

Instance Method Summary collapse

Instance Method Details

#kinesis_dataObject



5
6
7
8
9
10
11
# File 'lib/jets/event/helpers/kinesis_event.rb', line 5

def kinesis_data
  records = event["Records"]
  records.map do |record|
    encoded = record["kinesis"]["data"]
    Base64.decode64(encoded) # data
  end
end

#kinesis_data?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/jets/event/helpers/kinesis_event.rb', line 13

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