[Groonga-commit] ranguba/groonga-client at 01602b1 [master] Make select response enumerable

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Dec 13 00:09:49 JST 2016


Kouhei Sutou	2016-12-13 00:09:49 +0900 (Tue, 13 Dec 2016)

  New Revision: 01602b1ef927cb8a7318dd441bfc0c218edf13c6
  https://github.com/ranguba/groonga-client/commit/01602b1ef927cb8a7318dd441bfc0c218edf13c6

  Message:
    Make select response enumerable

  Modified files:
    lib/groonga/client/response/select.rb

  Modified: lib/groonga/client/response/select.rb (+6 -0)
===================================================================
--- lib/groonga/client/response/select.rb    2016-12-12 21:52:18 +0900 (bb679df)
+++ lib/groonga/client/response/select.rb    2016-12-13 00:09:49 +0900 (af4a714)
@@ -24,6 +24,8 @@ module Groonga
       class Select < Base
         Response.register("select", self)
 
+        include Enumerable
+
         # @return [Integer] The number of records that match againt
         #   a search condition.
         attr_accessor :n_hits
@@ -65,6 +67,10 @@ module Groonga
           records.size
         end
 
+        def each(&block)
+          records.each(&block)
+        end
+
         private
         def parse_body(body)
           if body.is_a?(::Array)
-------------- next part --------------
HTML����������������������������...
Télécharger 



More information about the Groonga-commit mailing list
Back to archive index