kcar RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Eric Wong <kcar-public@bogomips.org>
To: kcar-public@bogomips.org
Subject: [PATCH 4/6] response: more documentation cleanups
Date: Sun,  5 Mar 2017 23:13:14 +0000	[thread overview]
Message-ID: <20170305231316.8645-5-kcar-public@bogomips.org> (raw)
In-Reply-To: <20170305231316.8645-1-kcar-public@bogomips.org>

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.
---
 lib/kcar/response.rb | 10 ++++++----
 1 file 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
 
-- 
EW


  parent reply	other threads:[~2017-03-05 23:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-05 23:13 [PATCH 0/6] more minor doc updates Eric Wong
2017-03-05 23:13 ` [PATCH 1/6] update documentation for contributions, remove private address Eric Wong
2017-03-11 21:31   ` [PATCH] HACKING: remove copy+pasted line about N Eric Wong
2017-03-05 23:13 ` [PATCH 2/6] doc: minor updates to describe classes, better Eric Wong
2017-03-05 23:13 ` [PATCH 3/6] response: remove unnecessary constant alias Eric Wong
2017-03-05 23:13 ` Eric Wong [this message]
2017-03-05 23:13 ` [PATCH 5/6] favor require_relative to speed up loading Eric Wong
2017-03-05 23:13 ` [PATCH 6/6] response: remove Ruby 1.8-compatibility check Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://yhbt.net/kcar/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170305231316.8645-5-kcar-public@bogomips.org \
    --to=kcar-public@bogomips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/kcar.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).