Class: Droonga::Searcher::SimpleAttributesFormatter
- Inherits:
-
Object
- Object
- Droonga::Searcher::SimpleAttributesFormatter
- Includes:
- AttributeFormattable
- Defined in:
- lib/droonga/searcher.rb
Instance Method Summary collapse
- #format_attribute_column(label, column) ⇒ Object
- #format_attribute_expression(label, expression) ⇒ Object
- #format_attribute_subrecs(label, sub_attributes) ⇒ Object
- #format_attributes(attributes, table) ⇒ Object
Methods included from AttributeFormattable
Instance Method Details
#format_attribute_column(label, column) ⇒ Object
401 402 403 404 |
# File 'lib/droonga/searcher.rb', line 401 def format_attribute_column(label, column) vector = column.respond_to?(:vector?) ? column.vector? : false {"name" => label, "type" => column.range.name, "vector" => vector} end |
#format_attribute_expression(label, expression) ⇒ Object
406 407 408 |
# File 'lib/droonga/searcher.rb', line 406 def format_attribute_expression(label, expression) {"name" => label} # TODO include detailed information of expression end |
#format_attribute_subrecs(label, sub_attributes) ⇒ Object
394 395 396 397 398 399 |
# File 'lib/droonga/searcher.rb', line 394 def format_attribute_subrecs(label, sub_attributes) { "name" => label, "attributes" => sub_attributes, } end |
#format_attributes(attributes, table) ⇒ Object
410 411 412 413 414 |
# File 'lib/droonga/searcher.rb', line 410 def format_attributes(attributes, table) attributes.collect do |attribute| format_attribute(attribute, table) end end |