123456789_123456789_123456789_123456789_123456789_

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

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: lib/rack/lint.rb

Class Method Summary

Instance Method Summary

  • #close(*args)
    • close must never be called on the error stream.

  • #flush
    • flush must be called without arguments and must be called.

  • #puts(str)
    • puts must be called with a single argument that responds to to_s.

  • #write(str)
    • write must be called with a single argument that is a String.

Constructor Details

.new(error) ⇒ ErrorWrapper

[ GitHub ]

  
# File 'lib/rack/lint.rb', line 499

def initialize(error)
  @error = error
end

Instance Method Details

#close(*args)

  • close must never be called on the error stream.

Raises:

[ GitHub ]

  
# File 'lib/rack/lint.rb', line 521

def close(*args)
  raise LintError, "rack.errors#close must not be called"
end

#flush

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

[ GitHub ]

  
# File 'lib/rack/lint.rb', line 516

def flush
  @error.flush
end

#puts(str)

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

[ GitHub ]

  
# File 'lib/rack/lint.rb', line 504

def puts(str)
  @error.puts str
end

#write(str)

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

Raises:

[ GitHub ]

  
# File 'lib/rack/lint.rb', line 509

def write(str)
  raise LintError, "rack.errors#write not called with a String" unless str.kind_of? String
  @error.write str
end