diff options
author | Eric Wong <kcar-public@bogomips.org> | 2017-03-05 23:04:01 +0000 |
---|---|---|
committer | Eric Wong <kcar-public@bogomips.org> | 2017-03-05 23:04:01 +0000 |
commit | 877f64d3b470b9821a28ea75d2962de1a198cc0e (patch) | |
tree | a393dfede1bcff8ea1ba392a3db3cdaf4b803ea0 | |
parent | c72bf52b01bdd734204b4f414902fecd30aef948 (diff) | |
download | kcar-877f64d3b470b9821a28ea75d2962de1a198cc0e.tar.gz |
Our accessors are unfortunately set in stone, but there's no need to document them. The #each method should also yield a meaningful variable name for RDoc.
-rw-r--r-- | lib/kcar/response.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/kcar/response.rb b/lib/kcar/response.rb index af15ca0..7fa804b 100644 --- a/lib/kcar/response.rb +++ b/lib/kcar/response.rb @@ -4,7 +4,9 @@ # This may be used to generate a Rack response synchronously. class Kcar::Response + # :stopdoc: attr_accessor :sock, :hdr, :unchunk, :buf, :parser + # :startdoc: # By default we readpartial at most 16K off a socket at once READ_SIZE = 0x4000 @@ -60,11 +62,11 @@ class Kcar::Response def each return if @parser.body_eof? if @unchunk - @parser.chunked? ? each_unchunk { |x| yield x } : - each_identity { |x| yield x } + @parser.chunked? ? each_unchunk { |buf| yield buf } : + each_identity { |buf| yield buf } else - @parser.chunked? ? each_rechunk { |x| yield x } : - each_identity { |x| yield x } + @parser.chunked? ? each_rechunk { |buf| yield buf } : + each_identity { |buf| yield buf } end end |