Class: GSA::RecordsConverter

Inherits:
Object
  • Object
show all
Extended by:
Injector, XMLizer
Defined in:
lib/gsa/records_converter.rb

Class Method Summary collapse

Methods included from XMLizer

attributor, block, tag, xml

Methods included from Injector

inject, inject_a, inject_s

Class Method Details

.convert(args) ⇒ Object



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

def self.convert(args)
  records         = args[:records]
  searchable      = args[:searchable]
  datasource_name = args[:datasource_name]
  datasource_uri  = args[:datasource_uri]
  datasource_uid  = args[:datasource_uid]
  action          = args[:delete?] ? GSA::DELETE_ACTION : GSA::ADD_ACTION

  # if there is only one record, convert to the expected array.
  records = [records] if records.is_a? Hash

  layout(records, searchable, datasource_name, datasource_uri, datasource_uid, action)
end