Class: Seafoam::Formatters::Json::ListFormatter

Inherits:
Base::ListFormatter show all
Defined in:
lib/seafoam/formatters/json.rb

Overview

A JSON-based formatter for the ‘list` command.

Instance Attribute Summary

Attributes inherited from Base::ListFormatter

#entries

Instance Method Summary collapse

Methods inherited from Base::ListFormatter

#initialize

Constructor Details

This class inherits a constructor from Seafoam::Formatters::Base::ListFormatter

Instance Method Details

#formatObject



57
58
59
60
61
62
63
64
65
# File 'lib/seafoam/formatters/json.rb', line 57

def format
  entries.map do |entry|
    {
      graph_index: entry.index,
      graph_file: entry.file,
      graph_name_components: entry.graph_name_components,
    }
  end.to_json
end