class Rack::UTF8Sanitizer::SanitizedRackInput

Modeled after Rack::RewindableInput TODO: Should this delegate any methods to the original io?

Public Class Methods

new(original_io, sanitized_io) click to toggle source
# File lib/rack/utf8_sanitizer.rb, line 120
def initialize(original_io, sanitized_io)
  @original_io = original_io
  @sanitized_io = sanitized_io
end

Public Instance Methods

close() click to toggle source
# File lib/rack/utf8_sanitizer.rb, line 146
def close
  @sanitized_io.close
  @original_io.close if @original_io.respond_to?(:close)
end
each(&block) click to toggle source
# File lib/rack/utf8_sanitizer.rb, line 133
def each(&block)
  @sanitized_io.each(&block)
end
gets() click to toggle source
# File lib/rack/utf8_sanitizer.rb, line 125
def gets
  @sanitized_io.gets
end
read(*args) click to toggle source
# File lib/rack/utf8_sanitizer.rb, line 129
def read(*args)
  @sanitized_io.read(*args)
end
rewind() click to toggle source
# File lib/rack/utf8_sanitizer.rb, line 137
def rewind
  @sanitized_io.rewind
end
size() click to toggle source
# File lib/rack/utf8_sanitizer.rb, line 141
def size
  # StringIO#size is bytesize
  @sanitized_io.size
end