class PassStation::Output::Json

JSON formatter

Public Class Methods

format(table) click to toggle source

Format the +Array<CSV::Row>+ into JSON @param table [Array<CSV::Row>] an +Array<CSV::Row>+ @return [Array<String>] the formatted JSON ready to be printed (only

one element on the array, keep an array for compatibility with
{highlight_found} and homogeneity with other formatters)
# File lib/pass_station/output.rb, line 224
def format(table)
  [table.map(&:to_h).to_json]
end