Class: Rack::Lint::ErrorWrapper

Inherits:
Object
  • Object
show all
Includes:
Assertion
Defined in:
lib/action_controller/vendor/rack-1.0/rack/lint.rb

Instance Method Summary collapse

Methods included from Assertion

#assert

Constructor Details

#initialize(error) ⇒ ErrorWrapper

Returns a new instance of ErrorWrapper.



288
289
290
# File 'lib/action_controller/vendor/rack-1.0/rack/lint.rb', line 288

def initialize(error)
  @error = error
end

Instance Method Details

#close(*args) ⇒ Object

  • close must never be called on the error stream.



310
311
312
# File 'lib/action_controller/vendor/rack-1.0/rack/lint.rb', line 310

def close(*args)
  assert("rack.errors#close must not be called") { false }
end

#flushObject

  • flush must be called without arguments and must be called in order to make the error appear for sure.



305
306
307
# File 'lib/action_controller/vendor/rack-1.0/rack/lint.rb', line 305

def flush
  @error.flush
end

#puts(str) ⇒ Object

  • puts must be called with a single argument that responds to to_s.



293
294
295
# File 'lib/action_controller/vendor/rack-1.0/rack/lint.rb', line 293

def puts(str)
  @error.puts str
end

#write(str) ⇒ Object

  • write must be called with a single argument that is a String.



298
299
300
301
# File 'lib/action_controller/vendor/rack-1.0/rack/lint.rb', line 298

def write(str)
  assert("rack.errors#write not called with a String") { str.instance_of? String }
  @error.write str
end