Class: Rack::UTF8Sanitizer::SanitizedRackInput
- Inherits:
-
Object
- Object
- Rack::UTF8Sanitizer::SanitizedRackInput
- Defined in:
- lib/rack/utf8_sanitizer.rb
Overview
Modeled after Rack::RewindableInput TODO: Should this delegate any methods to the original io?
Instance Method Summary collapse
- #close ⇒ Object
- #each(&block) ⇒ Object
- #gets ⇒ Object
-
#initialize(original_io, sanitized_io) ⇒ SanitizedRackInput
constructor
A new instance of SanitizedRackInput.
- #read(*args) ⇒ Object
- #rewind ⇒ Object
- #size ⇒ Object
Constructor Details
#initialize(original_io, sanitized_io) ⇒ SanitizedRackInput
Returns a new instance of SanitizedRackInput.
140 141 142 143 |
# File 'lib/rack/utf8_sanitizer.rb', line 140 def initialize(original_io, sanitized_io) @original_io = original_io @sanitized_io = sanitized_io end |
Instance Method Details
#close ⇒ Object
166 167 168 169 |
# File 'lib/rack/utf8_sanitizer.rb', line 166 def close @sanitized_io.close @original_io.close if @original_io.respond_to?(:close) end |
#each(&block) ⇒ Object
153 154 155 |
# File 'lib/rack/utf8_sanitizer.rb', line 153 def each(&block) @sanitized_io.each(&block) end |
#gets ⇒ Object
145 146 147 |
# File 'lib/rack/utf8_sanitizer.rb', line 145 def gets @sanitized_io.gets end |
#read(*args) ⇒ Object
149 150 151 |
# File 'lib/rack/utf8_sanitizer.rb', line 149 def read(*args) @sanitized_io.read(*args) end |
#rewind ⇒ Object
157 158 159 |
# File 'lib/rack/utf8_sanitizer.rb', line 157 def rewind @sanitized_io.rewind end |
#size ⇒ Object
161 162 163 164 |
# File 'lib/rack/utf8_sanitizer.rb', line 161 def size # StringIO#size is bytesize @sanitized_io.size end |