Class: GSA::SearchConverter

Inherits:
Object
  • Object
show all
Defined in:
lib/gsa/search_converter.rb

Class Method Summary collapse

Class Method Details

.convert(convertable) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/gsa/search_converter.rb', line 4

def self.convert(convertable)

  results     = GSA::ReadableResults.extract(convertable)

  result_sets = GSA::ReadableResultSets.extract(results)
  result_sets = GSA::ReadableResultSets.parse(result_sets)
  
  if results.include?(GSA::FACETS)
    facets    = GSA::ReadableFacets.extract(results)
    facets    = GSA::ReadableFacets.parse(facets)
  end

  { :result_sets => result_sets, :facets => (facets || GSA::NO_RESULTS) }
end