Class: RubyLint::Presenter::JSON

Inherits:
Base
  • Object
show all
Defined in:
lib/ruby-lint/presenter/json.rb

Overview

JSON formats a instance of Report into a JSON formatted string.

Instance Method Summary collapse

Methods inherited from Base

register

Instance Method Details

#present(report) ⇒ String

Parameters:

Returns:



14
15
16
17
18
# File 'lib/ruby-lint/presenter/json.rb', line 14

def present(report)
  require 'json'

  return report.entries.sort.map(&:attributes).to_json
end