Class: KinesisAnalyticsConverter

Inherits:
Object
  • Object
show all
Defined in:
lib/kinesis/aggregation/kinesis_analytics_converter.rb

Instance Method Summary collapse

Constructor Details

#initialize(kinesis_analytics_record) ⇒ KinesisAnalyticsConverter

Returns a new instance of KinesisAnalyticsConverter.



2
3
4
# File 'lib/kinesis/aggregation/kinesis_analytics_converter.rb', line 2

def initialize(kinesis_analytics_record)
  @kinesis_analytics_record = kinesis_analytics_record
end

Instance Method Details

#convertObject



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/kinesis/aggregation/kinesis_analytics_converter.rb', line 6

def convert
  {
    kinesis: {
      kinesisSchemaVersion: '1.0',
      sequenceNumber: @kinesis_analytics_record[:kinesisStreamRecordMetadata][:sequenceNumber],
      partitionKey: @kinesis_analytics_record[:kinesisStreamRecordMetadata][:partitionKey],
      approximateArrivalTimestamp: @kinesis_analytics_record[:kinesisStreamRecordMetadata][:approximateArrivalTimestamp],
      shardId: @kinesis_analytics_record[:kinesisStreamRecordMetadata][:shardId],
      data: @kinesis_analytics_record[:data],
      recordId: @kinesis_analytics_record[:recordId]
    }
  }
end