Kouhei Sutou
null+****@clear*****
Fri Aug 5 11:37:43 JST 2016
Kouhei Sutou 2016-08-05 11:37:43 +0900 (Fri, 05 Aug 2016) New Revision: a68412c7f0eab3790c0c19094dafeb84c059e571 https://github.com/groonga/groonga-command/commit/a68412c7f0eab3790c0c19094dafeb84c059e571 Message: table_create: support #value_type Modified files: lib/groonga/command/table-create.rb test/command/test-table-create.rb Modified: lib/groonga/command/table-create.rb (+9 -0) =================================================================== --- lib/groonga/command/table-create.rb 2016-08-03 10:11:14 +0900 (d845c4e) +++ lib/groonga/command/table-create.rb 2016-08-05 11:37:43 +0900 (66644ca) @@ -41,6 +41,15 @@ module Groonga self[:key_type] end + # @return [String, nil] Value type name, `nil` for no value + # table. Double array trie table always returns `nil` because + # double array trie table doesn't support value. + # + # @since 1.2.2 + def value_type + self[:value_type] + end + def flags @flags ||= (self[:flags] || "").split(/\s*\|\s*/) end Modified: test/command/test-table-create.rb (+12 -0) =================================================================== --- test/command/test-table-create.rb 2016-08-03 10:11:14 +0900 (c90c9fb) +++ test/command/test-table-create.rb 2016-08-05 11:37:43 +0900 (5f011c2) @@ -67,6 +67,18 @@ class TableCreateCommandTest < Test::Unit::TestCase end end + class ValueTypeTest < self + def test_specified + command = table_create_command({"value_type" => "UInt64"}) + assert_equal("UInt64", command.value_type) + end + + def test_omitted + command = table_create_command + assert_nil(command.value_type) + end + end + class FlagsTest < self def test_multiple command = table_create_command({"flags" => "TABLE_PAT_KEY|KEY_WITH_SIS"}) -------------- next part -------------- HTML����������������������������... Descargar