[Groonga-commit] droonga/fluent-plugin-droonga at aae308c [master] schema: Add ColumnIndexOptions class

Back to archive index

Yoji Shidara null+****@clear*****
Tue Feb 18 14:26:19 JST 2014


Yoji Shidara	2014-02-18 14:26:19 +0900 (Tue, 18 Feb 2014)

  New Revision: aae308c3db49301462e310131f0f5f19053d9208
  https://github.com/droonga/fluent-plugin-droonga/commit/aae308c3db49301462e310131f0f5f19053d9208

  Message:
    schema: Add ColumnIndexOptions class

  Modified files:
    lib/droonga/catalog/schema.rb

  Modified: lib/droonga/catalog/schema.rb (+25 -1)
===================================================================
--- lib/droonga/catalog/schema.rb    2014-02-18 14:25:14 +0900 (e23cda3)
+++ lib/droonga/catalog/schema.rb    2014-02-18 14:26:19 +0900 (c28fbce)
@@ -16,11 +16,30 @@
 module Droonga
   module Catalog
     class Schema
+      class ColumnIndexOptions
+        def initialize(data)
+          @data = data
+        end
+
+        def with_section
+          @data["withSection"]
+        end
+
+        def with_weight
+          @data["withWeight"]
+        end
+
+        def with_position
+          @data["withPosition"]
+        end
+      end
+
       class Column
-        attr_reader :name, :data
+        attr_reader :name, :data, :index_options
         def initialize(name, data)
           @name = name
           @data = data
+          @index_options = ColumnIndexOptions.new(index_options_data)
         end
 
         def ==(other)
@@ -28,6 +47,11 @@ module Droonga
             name == other.name and
             data == other.data
         end
+
+        private
+        def index_options_data
+          @data["index_options"] || {}
+        end
       end
 
       class Table
-------------- next part --------------
HTML����������������������������...
Download 



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