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
404 405 406 407 |
# File 'lib/droonga/searcher.rb', line 404 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
409 410 411 |
# File 'lib/droonga/searcher.rb', line 409 def format_attribute_expression(label, expression) {"name" => label} # TODO include detailed information of expression end |
#format_attribute_subrecs(label, sub_attributes) ⇒ Object
397 398 399 400 401 402 |
# File 'lib/droonga/searcher.rb', line 397 def format_attribute_subrecs(label, sub_attributes) { "name" => label, "attributes" => sub_attributes, } end |
#format_attributes(attributes, table) ⇒ Object
413 414 415 416 417 |
# File 'lib/droonga/searcher.rb', line 413 def format_attributes(attributes, table) attributes.collect do |attribute| format_attribute(attribute, table) end end |