Class: Droonga::Searcher::ResultFormatter
- Inherits:
-
Object
- Object
- Droonga::Searcher::ResultFormatter
- Defined in:
- lib/droonga/searcher.rb
Class Method Summary collapse
Instance Method Summary collapse
- #format ⇒ Object
-
#initialize(search_request, search_result) ⇒ ResultFormatter
constructor
A new instance of ResultFormatter.
Constructor Details
#initialize(search_request, search_result) ⇒ ResultFormatter
Returns a new instance of ResultFormatter.
634 635 636 637 |
# File 'lib/droonga/searcher.rb', line 634 def initialize(search_request, search_result) @request = search_request @result = search_result end |
Class Method Details
.format(search_request, search_result) ⇒ Object
629 630 631 |
# File 'lib/droonga/searcher.rb', line 629 def format(search_request, search_result) new(search_request, search_result).format end |
Instance Method Details
#format ⇒ Object
639 640 641 642 643 644 645 646 647 648 649 |
# File 'lib/droonga/searcher.rb', line 639 def format formatted_result = {} output_elements.each do |name| value = format_element(name) next if value.nil? formatted_result[name] = value end formatted_result end |