lib/pheme/queue_poller.rb in pheme-4.1.1 vs lib/pheme/queue_poller.rb in pheme-5.0.0
- old
+ new
@@ -125,19 +125,15 @@
decompress(body['Message'])
end
def parse_csv(message_contents)
parsed_body = SmarterCSV.process(StringIO.new(message_contents))
- # rubocop:disable Vendor/RecursiveOpenStructUse
- parsed_body.map { |item| RecursiveOpenStruct.new(item, recurse_over_arrays: true) }
- # rubocop:enable Vendor/RecursiveOpenStructUse
+ parsed_body.map { |item| ResourceStruct::FlexStruct.new(item) }
end
def parse_json(message_contents)
parsed_body = JSON.parse(message_contents)
- # rubocop:disable Vendor/RecursiveOpenStructUse
- RecursiveOpenStruct.new({ wrapper: parsed_body }, recurse_over_arrays: true).wrapper
- # rubocop:enable Vendor/RecursiveOpenStructUse
+ ResourceStruct::FlexStruct.new({ wrapper: parsed_body }).wrapper
end
def handle(message, metadata, message_attributes)
if @message_handler
@message_handler.new(message: message, metadata: metadata, message_attributes: message_attributes).handle