Class: Rack::Lint::ErrorWrapper

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

Instance Method Summary collapse

Methods included from Assertion

#assert

Constructor Details

#initialize(error) ⇒ ErrorWrapper

Returns a new instance of ErrorWrapper.



495
496
497
# File 'lib/rack/lint.rb', line 495

def initialize(error)
  @error = error
end

Instance Method Details

#close(*args) ⇒ Object

  • close must never be called on the error stream.

Raises:



517
518
519
# File 'lib/rack/lint.rb', line 517

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.



512
513
514
# File 'lib/rack/lint.rb', line 512

def flush
  @error.flush
end

#puts(str) ⇒ Object

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



500
501
502
# File 'lib/rack/lint.rb', line 500

def puts(str)
  @error.puts str
end

#write(str) ⇒ Object

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

Raises:



505
506
507
508
# File 'lib/rack/lint.rb', line 505

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