提交 9714a9b0 编写于 作者: J Jeremy Kemper

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

上级 e73445ba
......@@ -3,12 +3,12 @@ class RewindableInput
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册