require 'yajl' module Hover module Decoder class JSONStream def initialize(s3_object, block = ->(object) {}) @parser = Yajl::Parser.new @s3_object = s3_object @parser.on_parse_complete = block end def start bucket_name = @s3_object.bucket.name key = @s3_object.key @s3_object.client.get_object(bucket: bucket_name, key: key) do |chunk| @parser << chunk end end end end end