From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id DA2DD202FE for ; Sun, 5 Mar 2017 23:13:18 +0000 (UTC) From: Eric Wong To: kcar-public@bogomips.org Subject: [PATCH 4/6] response: more documentation cleanups Date: Sun, 5 Mar 2017 23:13:14 +0000 Message-Id: <20170305231316.8645-5-kcar-public@bogomips.org> In-Reply-To: <20170305231316.8645-1-kcar-public@bogomips.org> References: <20170305231316.8645-1-kcar-public@bogomips.org> List-Id: 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