Class: Unipept::UrlFormatter

Inherits:
Formatter show all
Defined in:
lib/formatters.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Formatter

available, default, #format, formatters, #group_by_first_key, #integrate_fasta_headers, new_for_format, register

Class Method Details

.hidden?Boolean

Returns:

  • (Boolean)


388
389
390
# File 'lib/formatters.rb', line 388

def self.hidden?
  false
end

Instance Method Details

#convert(data, _first) ⇒ String

Converts the given input data to an HTML page that contains the Unipept visualizations

Parameters:

  • data (Array)

    The data we wish to convert

  • Is (Boolean)

    this the first output batch?

Returns:

  • (String)

    The converted input data in the Blast format



407
408
409
# File 'lib/formatters.rb', line 407

def convert(data, _first)
  "#{data[0]['gist'].sub!('https://gist.github.com/', 'https://bl.ocks.org/')}\n"
end


396
397
398
# File 'lib/formatters.rb', line 396

def footer
  ''
end

#header(_data, _fasta_mapper = nil) ⇒ Object



392
393
394
# File 'lib/formatters.rb', line 392

def header(_data, _fasta_mapper = nil)
  ''
end

#typeString

Returns The type of the current formatter: html.

Returns:

  • (String)

    The type of the current formatter: html



384
385
386
# File 'lib/formatters.rb', line 384

def type
  'url'
end