title: How to create an IO object for Aws::S3::Object to stream d/l line by line?
body: <p>Ruby novice here. I'd like to stream a large S3 object (text file) and process it line at a time. I don't want to store the object data locally or load it fully in memory. <a href="http://docs.aws.amazon.com/sdkforruby/api/Aws/S3/Object.html#get-instance_method" rel="nofollow"><code>Aws::S3::Object#get()</code></a> takes a hash whose <code>response_target</code> parameter can take an IO object but I am unsure how to subclass or instantiate an <code>IO</code> instance to do what I want. </p>
  
  <p>I'd like to end up with something like:</p>
  
  <pre class="lang-rb prettyprint-override"><code>line_reader = nil # TODO make my IO instance
  
  s3_obj = s3.bucket('bucket-name').object('key')
  s3_obj.get({response_target: line_reader}) # returns as soon as streaming begins?
  
  # line_reader does not accumulate response data in memory
  line_reader.each do | text_line | 
    # do processing on each line independently
  end
  </code></pre>
  
  <p>Thank you!</p>