Kouhei Sutou
null+****@clear*****
Wed Dec 7 23:54:11 JST 2016
Kouhei Sutou 2016-12-07 23:54:11 +0900 (Wed, 07 Dec 2016) New Revision: 69711654382a0fda583b259ed59463078ed9ddfb https://github.com/ranguba/groonga-client/commit/69711654382a0fda583b259ed59463078ed9ddfb Message: Rename Response::Load#ids to #loaded_ids Modified files: lib/groonga/client/response/load.rb test/response/test-load.rb Modified: lib/groonga/client/response/load.rb (+7 -3) =================================================================== --- lib/groonga/client/response/load.rb 2016-12-06 16:54:50 +0900 (786e05c) +++ lib/groonga/client/response/load.rb 2016-12-07 23:54:11 +0900 (3c04193) @@ -24,6 +24,8 @@ module Groonga Response.register("load", self) # @return [Integer] The number of loaded records. + # + # @since 0.3.2 attr_accessor :n_loaded_records # @return [::Array<Integer>] The IDs of loaded records. ID is @@ -31,7 +33,9 @@ module Groonga # # If you don't specify `yes` to `output_ids` `load` # parameter, this is always an empty array. - attr_accessor :ids + # + # @since 0.3.3 + attr_accessor :loaded_ids def body=(body) super(body) @@ -42,10 +46,10 @@ module Groonga def parse_body(body) if body.is_a?(::Hash) @n_loaded_records = body["n_loaded_records"] - @ids = body["ids"] || [] + @loaded_ids = body["loaded_ids"] || [] else @n_loaded_records = body - @ids = [] + @loaded_ids = [] end end end Modified: test/response/test-load.rb (+5 -5) =================================================================== --- test/response/test-load.rb 2016-12-06 16:54:50 +0900 (eefb9da) +++ test/response/test-load.rb 2016-12-07 23:54:11 +0900 (f8116ca) @@ -43,12 +43,12 @@ class TestResponseLoad < Test::Unit::TestCase end end - sub_test_case("#ids") do + sub_test_case("#loaded_ids") do test("command_version=1") do command = Groonga::Command::Load.new("load", {"command_version" => "1"}) response = create_response(command, 29) - assert_equal([], response.ids) + assert_equal([], response.loaded_ids) end sub_test_case("command_version=3") do @@ -65,13 +65,13 @@ class TestResponseLoad < Test::Unit::TestCase "command_version" => "3", "output_ids" => "yes", }) - ids = [1, 2, 0, 4, 3] + loaded_ids = [1, 2, 0, 4, 3] response = create_response(command, { "n_loaded_records" => 4, - "ids" => ids, + "loaded_ids" => loaded_ids, }) - assert_equal(ids, response.ids) + assert_equal(loaded_ids, response.loaded_ids) end end end -------------- next part -------------- HTML����������������������������... Download