Class: Droonga::Catalog::Schema::Table
- Inherits:
-
Object
- Object
- Droonga::Catalog::Schema::Table
- Defined in:
- lib/droonga/catalog/schema.rb
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(name, data) ⇒ Table
constructor
A new instance of Table.
- #key_type ⇒ Object
- #key_type_groonga ⇒ Object
- #normalizer ⇒ Object
- #tokenizer ⇒ Object
- #type ⇒ Object
- #type_symbol ⇒ Object
Constructor Details
#initialize(name, data) ⇒ Table
Returns a new instance of Table.
108 109 110 111 112 113 114 115 116 |
# File 'lib/droonga/catalog/schema.rb', line 108 def initialize(name, data) @name = name @data = data @columns = {} columns_data.each do |column_name, column_data| @columns[column_name] = Column.new(name, column_name, column_data) end end |
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
107 108 109 |
# File 'lib/droonga/catalog/schema.rb', line 107 def columns @columns end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
107 108 109 |
# File 'lib/droonga/catalog/schema.rb', line 107 def data @data end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
107 108 109 |
# File 'lib/droonga/catalog/schema.rb', line 107 def name @name end |
Instance Method Details
#==(other) ⇒ Object
118 119 120 121 122 |
# File 'lib/droonga/catalog/schema.rb', line 118 def ==(other) self.class == other.class and name == other.name and data == other.data end |
#key_type ⇒ Object
141 142 143 |
# File 'lib/droonga/catalog/schema.rb', line 141 def key_type @data["keyType"] end |
#key_type_groonga ⇒ Object
145 146 147 148 149 150 151 152 153 154 |
# File 'lib/droonga/catalog/schema.rb', line 145 def key_type_groonga case key_type when "Integer" "Int64" when "Float", "Time", "ShortText", "TokyoGeoPoint", "WGS84GeoPoint" key_type else key_type end end |
#normalizer ⇒ Object
160 161 162 |
# File 'lib/droonga/catalog/schema.rb', line 160 def normalizer @data["normalizer"] end |
#tokenizer ⇒ Object
156 157 158 |
# File 'lib/droonga/catalog/schema.rb', line 156 def tokenizer @data["tokenizer"] end |
#type ⇒ Object
124 125 126 |
# File 'lib/droonga/catalog/schema.rb', line 124 def type @data["type"] || "Hash" end |
#type_symbol ⇒ Object
128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/droonga/catalog/schema.rb', line 128 def type_symbol case type when "Array" :array when "Hash" :hash when "PatriciaTrie" :patricia_trie when "DoubleArrayTrie" :double_array_trie end end |