Class: Rack::Lint::Wrapper::ErrorWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/lint.rb

Instance Method Summary collapse

Constructor Details

#initialize(error) ⇒ ErrorWrapper

Returns a new instance of ErrorWrapper.

 581 582 583
# File 'lib/rack/lint.rb', line 581 def initialize(error) @error = error end

Instance Method Details

#close(*args) ⇒ Object

  • close must never be called on the error stream.

Raises:

 602 603 604
# File 'lib/rack/lint.rb', line 602 def close(*args) raise LintError, "rack.errors#close must not be called" end

#flushObject

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

 597 598 599
# File 'lib/rack/lint.rb', line 597 def flush @error.flush end

#puts(str) ⇒ Object

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

 586 587 588
# File 'lib/rack/lint.rb', line 586 def puts(str) @error.puts str end

#write(str) ⇒ Object

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

Raises:

 591 592 593 594
# File 'lib/rack/lint.rb', line 591 def write(str) raise LintError, "rack.errors#write not called with a String" unless str.kind_of? String @error.write str end