[Groonga-commit] ranguba/groonga-client at 681d691 [master] Add Response::ColumnList::Column#full_name

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Oct 30 14:52:42 JST 2017


Kouhei Sutou	2017-10-30 14:52:42 +0900 (Mon, 30 Oct 2017)

  New Revision: 681d69162b762742e0541fd8a123d94aeae08988
  https://github.com/ranguba/groonga-client/commit/681d69162b762742e0541fd8a123d94aeae08988

  Message:
    Add Response::ColumnList::Column#full_name

  Modified files:
    lib/groonga/client/response/column-list.rb
    test/response/test-column-list.rb

  Modified: lib/groonga/client/response/column-list.rb (+8 -0)
===================================================================
--- lib/groonga/client/response/column-list.rb    2017-10-30 14:49:44 +0900 (b6ff4aa)
+++ lib/groonga/client/response/column-list.rb    2017-10-30 14:52:42 +0900 (7f4d3c9)
@@ -64,6 +64,14 @@ module Groonga
                                   :domain,
                                   :range,
                                   :source)
+          # @return [String]
+          #   The column name with table name such as `TABLE.COLUMN`.
+          #
+          # @since 0.5.4
+          def full_name
+            "#{domain}.#{name}"
+          end
+
           # @return [::Array<String>]
           #   The flag names of the column.
           #

  Modified: test/response/test-column-list.rb (+24 -0)
===================================================================
--- test/response/test-column-list.rb    2017-10-30 14:49:44 +0900 (192a993)
+++ test/response/test-column-list.rb    2017-10-30 14:52:42 +0900 (fd97b49)
@@ -93,6 +93,30 @@ class TestResponseColumnList < Test::Unit::TestCase
       Groonga::Client::Response::ColumnList.new(@command, header, body)
     end
 
+    class TestFullName < self
+      def create_response(domain, name)
+        columns = [
+          [
+            256,
+            name,
+            "/tmp/test.db.0000100",
+            "var",
+            "COLUMN_SCALAR|PERSISTENT",
+            domain,
+            "ShortText",
+            [],
+          ]
+        ]
+        super(columns)
+      end
+
+      def test_full_name
+        response = create_response("Memos", "content")
+        assert_equal("Memos.content",
+                     response[0].full_name)
+      end
+    end
+
     class TestFlags < self
       def create_response(flags)
         columns = [
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20171030/6c595eb3/attachment-0001.htm 



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