class Groonga::Client::Response::Schema::Table

Public Class Methods

new(schema) click to toggle source
Calls superclass method
# File lib/groonga/client/response/schema.rb, line 253
def initialize(schema)
  @schema = schema
  super()
end

Public Instance Methods

[]=(key, value) click to toggle source
Calls superclass method
# File lib/groonga/client/response/schema.rb, line 258
def []=(key, value)
  case key.to_sym
  when :key_type
    super(key, coerce_key_type(value))
  when :tokenizer
    super(key, coerce_tokenizer(value))
  when :normalizer
    super(key, coerce_normalizer(value))
  when :columns
    super(key, coerce_columns(value))
  when :indexes
    super(key, coerce_indexes(value))
  when :command
    super(key, Command.new(value))
  else
    super
  end
end
have_full_text_search_index?() click to toggle source
# File lib/groonga/client/response/schema.rb, line 277
def have_full_text_search_index?
  indexes.any? do |index|
    index.full_text_searchable?
  end
end

Private Instance Methods

coerce_columns(raw_columns) click to toggle source
# File lib/groonga/client/response/schema.rb, line 316
def coerce_columns(raw_columns)
  HashValueConverter.convert(raw_columns) do |raw_column|
    Column.new(@schema, raw_column)
  end
end
coerce_indexes(raw_indexes) click to toggle source
# File lib/groonga/client/response/schema.rb, line 322
def coerce_indexes(raw_indexes)
  raw_indexes.collect do |raw_index|
    Index.new(@schema, raw_index)
  end
end
coerce_key_type(raw_key_type) click to toggle source
# File lib/groonga/client/response/schema.rb, line 284
def coerce_key_type(raw_key_type)
  if raw_key_type.nil?
    nil
  elsif raw_key_type["type"] == "type"
    @schema.types[raw_key_type["name"]]
  else
    @schema.tables[raw_key_type["name"]]
  end
end
coerce_normalizer(raw_normalizer) click to toggle source
# File lib/groonga/client/response/schema.rb, line 302
def coerce_normalizer(raw_normalizer)
  if raw_normalizer.nil?
    nil
  else
    @schema.normalizers[raw_normalizer["name"]]
  end
end
coerce_token_filters(raw_token_filters) click to toggle source
# File lib/groonga/client/response/schema.rb, line 310
def coerce_token_filters(raw_token_filters)
  raw_token_filters.collect do |raw_token_filter|
    TokenFilter[raw_token_filter]
  end
end
coerce_tokenizer(raw_tokenizer) click to toggle source
# File lib/groonga/client/response/schema.rb, line 294
def coerce_tokenizer(raw_tokenizer)
  if raw_tokenizer.nil?
    nil
  else
    @schema.tokenizers[raw_tokenizer["name"]]
  end
end