1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Use toplevel reference to ::StringIO since we're in a BasicObject.

This commit is contained in:
Jeremy Kemper 2009-01-27 09:44:07 -08:00
parent e73445ba1b
commit 9714a9b001

View file

@ -3,12 +3,12 @@ module ActionController
class RewindableIO < ActiveSupport::BasicObject
def initialize(io)
@io = io
@rewindable = io.is_a?(StringIO)
@rewindable = io.is_a?(::StringIO)
end
def method_missing(method, *args, &block)
unless @rewindable
@io = StringIO.new(@io.read)
@io = ::StringIO.new(@io.read)
@rewindable = true
end