Class: Hone::Formatters::JSON

Inherits:
Base
  • Object
show all
Defined in:
lib/hone/formatters/json.rb

Constant Summary collapse

FORMAT_VERSION =
"1.0.0"

Constants included from Filterable

Filterable::PRIORITY_LABELS

Instance Method Summary collapse

Methods included from Filterable

#filter_cold, #format_percent, #priority_label

Constructor Details

#initialize(findings, options = {}) ⇒ JSON

Returns a new instance of JSON.



10
11
12
13
14
# File 'lib/hone/formatters/json.rb', line 10

def initialize(findings, options = {})
  super
  @profile_path = options[:profile_path]
  @mode = options.fetch(:mode, "correlated")
end

Instance Method Details

#formatObject



16
17
18
# File 'lib/hone/formatters/json.rb', line 16

def format
  ::JSON.pretty_generate(build_output)
end