Class: Rack::Response

Inherits:
Object show all
Defined in:
lib/rad/http/_support/rack/fixes.rb

Overview

Rack doesn’t works well with ruby 1.9.2 there’s no :each method in String anymore

Direct Known Subclasses

Rad::Http::Response

Instance Method Summary collapse

Instance Method Details

#each(&callback) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/rad/http/_support/rack/fixes.rb', line 6

def each(&callback)
  if @body.is_a? String
    @body.each_char(&callback)
  else
    @body.each(&callback)
  end
  @writer = callback
  @block.call(self)  if @block
end