Module: Droonga::Searcher::AttributeFormattable

Included in:
ComplexAttributesFormatter, SimpleAttributesFormatter
Defined in:
lib/droonga/searcher.rb

Instance Method Summary collapse

Instance Method Details

#format_attribute(attribute, table) ⇒ Object



414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
# File 'lib/droonga/searcher.rb', line 414

def format_attribute(attribute, table)
  label = attribute[:label]
  source = attribute[:source]
  if source == "_subrecs"
    sub_record_table = table.range
    sub_attributes = format_attributes(attribute[:attributes], sub_record_table)

    format_attribute_subrecs(label, sub_attributes)
  else
    expression = attribute[:expression]
    if expression
      format_attribute_expression(label, expression)
    else
      column = table.column(source)
      format_attribute_column(label, column)
    end
  end
end