Class: GSA::ReadableResultSets

Inherits:
ReadableResults show all
Defined in:
lib/gsa/readable_results/readable_result_sets.rb

Class Method Summary collapse

Methods inherited from ReadableResults

parse_core

Methods included from Injector

#inject, #inject_a, #inject_s

Class Method Details

.convert(set) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/gsa/readable_results/readable_result_sets.rb', line 12

def self.convert(set)
  {
    :result_number         => set[GSA::RESULT_NUMBER], 
    :url                   => set[GSA::URL],
    :title                 => set[GSA::TITLE],
    :metatags              => GSA::ReadableMetatags.parse(set[GSA::METATAGS]),
    :search_result_snippet => set[GSA::SEARCH_RESULT_SNIPPET]
  } 
end

.extract(search_results) ⇒ Object



4
5
6
# File 'lib/gsa/readable_results/readable_result_sets.rb', line 4

def self.extract(search_results)
  (search_results.select {|key, value| key == GSA::RESULT })[GSA::RESULT]
end

.parse(results_sets) ⇒ Object



8
9
10
# File 'lib/gsa/readable_results/readable_result_sets.rb', line 8

def self.parse(results_sets)
  parse_core(results_sets) {|set| convert(set) }
end