Class: Groonga::Client::Response::Schema
- Defined in:
- lib/groonga/client/response/schema.rb
Overview
The response class for schema
command.
Defined Under Namespace
Modules: HashValueConverter Classes: Column, Index, KeyType, Normalizer, Table, TokenFilter, Tokenizer, Type, ValueType
Instance Attribute Summary
Attributes inherited from Base
#body, #command, #header, #raw
Instance Method Summary collapse
-
#normalizers ⇒ Hash<String, Normalizer>
Key is normalizer name and value is the definition of the normalizer.
-
#tables ⇒ Hash<String, Table>
Key is table name and value is the definition of the table.
-
#token_filters ⇒ Hash<String, TokenFilter>
Key is token filter name and value is the definition of the token filter.
-
#tokenizers ⇒ Hash<String, Tokenizer>
Key is tokenizer name and value is the definition of the tokenizer.
-
#types ⇒ Hash<String, Type>
Key is type name and value is the definition of the type.
Methods inherited from Base
#elapsed_time, #error_message, #initialize, parse, #return_code, #start_time, #status_code, #success?
Constructor Details
This class inherits a constructor from Groonga::Client::Response::Base
Instance Method Details
#normalizers ⇒ Hash<String, Normalizer>
Returns Key is normalizer name and value is the definition of the normalizer.
52 53 54 55 56 |
# File 'lib/groonga/client/response/schema.rb', line 52 def normalizers @normalizers ||= HashValueConverter.convert(@body["normalizers"]) do |normalizer| Normalizer[normalizer] end end |
#tables ⇒ Hash<String, Table>
Returns Key is table name and value is the definition of the table.
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/groonga/client/response/schema.rb', line 72 def tables @tables ||= nil return @tables if @tables @tables = {} @body["tables"].each do |key, _| @tables[key] = Table.new(self) end @body["tables"].each do |key, raw_table| table = @tables[key] raw_table.each do |table_key, table_value| table[table_key] = table_value end end @tables end |
#token_filters ⇒ Hash<String, TokenFilter>
Returns Key is token filter name and value is the definition of the token filter.
62 63 64 65 66 |
# File 'lib/groonga/client/response/schema.rb', line 62 def token_filters @token_filters ||= HashValueConverter.convert(@body["token_filters"]) do |token_filter| TokenFilter[token_filter] end end |
#tokenizers ⇒ Hash<String, Tokenizer>
Returns Key is tokenizer name and value is the definition of the tokenizer.
42 43 44 45 46 |
# File 'lib/groonga/client/response/schema.rb', line 42 def tokenizers @tokenizers ||= HashValueConverter.convert(@body["tokenizers"]) do |tokenizer| Tokenizer[tokenizer] end end |
#types ⇒ Hash<String, Type>
Returns Key is type name and value is the definition of the type.
32 33 34 35 36 |
# File 'lib/groonga/client/response/schema.rb', line 32 def types @types ||= HashValueConverter.convert(@body["types"]) do |raw_type| Type[raw_type] end end |