Class: PassStation::Output::Yaml

Inherits:
Object
  • Object
show all
Defined in:
lib/pass_station/output.rb

Overview

YAML formatter

Class Method Summary collapse

Class Method Details

.format(table) ⇒ Array<String>

Format the Array<CSV::Row> into YAML

Parameters:

  • table (Array<CSV::Row>)

    an Array<CSV::Row>

Returns:

  • (Array<String>)

    the formatted YAML ready to be printed (only one element on the array, keep an array for compatibility with DB#highlight_found and homogeneity with other formatters)



237
238
239
# File 'lib/pass_station/output.rb', line 237

def format(table)
  [table.map(&:to_h).to_yaml]
end