Class: Groonga::Client::Response::Schema::Index

Inherits:
Hash
  • Object
show all
Includes:
Hashie::Extensions::MethodAccess
Defined in:
lib/groonga/client/response/schema.rb

Overview

Since:

  • 0.2.2

Instance Method Summary collapse

Constructor Details

#initialize(schema, raw_index) ⇒ Index

Returns a new instance of Index.

Since:

  • 0.2.2



175
176
177
178
179
180
181
# File 'lib/groonga/client/response/schema.rb', line 175

def initialize(schema, raw_index)
  @schema = schema
  super()
  raw_index.each do |key, value|
    self[key] = value
  end
end

Instance Method Details

#[]=(key, value) ⇒ Object

Since:

  • 0.2.2



183
184
185
186
187
188
189
190
# File 'lib/groonga/client/response/schema.rb', line 183

def []=(key, value)
  case key.to_sym
  when :table
    super(key, coerce_table(value))
  else
    super
  end
end

#columnObject

Since:

  • 0.2.2



192
193
194
195
196
197
198
199
# File 'lib/groonga/client/response/schema.rb', line 192

def column
  column_name = name
  if column_name.nil?
    column_name
  else
    table.columns[column_name]
  end
end

#full_text_searchable?Boolean

Returns:

  • (Boolean)

Since:

  • 0.2.2



201
202
203
# File 'lib/groonga/client/response/schema.rb', line 201

def full_text_searchable?
  table.tokenizer and column.position
end