Kouhei Sutou
null+****@clear*****
Mon Aug 8 11:30:53 JST 2016
Kouhei Sutou 2016-08-08 11:30:53 +0900 (Mon, 08 Aug 2016) New Revision: 1e3c60faea5b97cc054954a5ae997fdc92ff5918 https://github.com/groonga/groonga-command/commit/1e3c60faea5b97cc054954a5ae997fdc92ff5918 Message: Add ColumnCreate#name Modified files: lib/groonga/command/column-create.rb test/command/test-column-create.rb Modified: lib/groonga/command/column-create.rb (+7 -0) =================================================================== --- lib/groonga/command/column-create.rb 2016-08-08 11:20:32 +0900 (ef2f788) +++ lib/groonga/command/column-create.rb 2016-08-08 11:30:53 +0900 (698664d) @@ -43,6 +43,13 @@ module Groonga self[:table] end + # @return [String] The column name. + # + # @since 1.2.4 + def name + self[:name] + end + def flags @flags ||= (self[:flags] || "").split(/\s*\|\s*/) end Modified: test/command/test-column-create.rb (+9 -3) =================================================================== --- test/command/test-column-create.rb 2016-08-08 11:20:32 +0900 (1d61d6c) +++ test/command/test-column-create.rb 2016-08-08 11:30:53 +0900 (83aa7eb) @@ -1,6 +1,4 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2012-2014 Kouhei Sutou <kou �� clear-code.com> +# Copyright (C) 2012-2016 Kouhei Sutou <kou �� clear-code.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -51,6 +49,14 @@ class ColumnCreateCommandTest < Test::Unit::TestCase end end + class NameTest < self + def test_reader + command = column_create_command({"name" => "message"}) + assert_equal("message", + command.name) + end + end + class FlagsTest < self def test_multiple command = column_create_command({"flags" => "COLUMN_INDEX|WITH_POSITION"}) -------------- next part -------------- HTML����������������������������... 다운로드