Class: Unipept::XMLFormatter
Instance Method Summary collapse
-
#convert(data, _first) ⇒ String
Converts the given input data to the XML format.
- #footer ⇒ Object
- #header(_data, _fasta_mapper = nil) ⇒ Object
-
#type ⇒ String
The type of the current formatter: xml.
Methods inherited from Formatter
available, default, #format, formatters, #group_by_first_key, hidden?, #integrate_fasta_headers, new_for_format, register
Instance Method Details
#convert(data, _first) ⇒ String
Converts the given input data to the XML format.
306 307 308 |
# File 'lib/formatters.rb', line 306 def convert(data, _first) data.map { |row| "<result>#{row.to_xml}</result>" }.join end |
#footer ⇒ Object
295 296 297 |
# File 'lib/formatters.rb', line 295 def "</results>\n" end |
#header(_data, _fasta_mapper = nil) ⇒ Object
291 292 293 |
# File 'lib/formatters.rb', line 291 def header(_data, _fasta_mapper = nil) '<results>' end |
#type ⇒ String
Returns The type of the current formatter: xml.
287 288 289 |
# File 'lib/formatters.rb', line 287 def type 'xml' end |