Class: Cane::JsonFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/cane/json_formatter.rb

Overview

Computes a machine-readable JSON representation from an array of violations computed by the checks.

Instance Method Summary collapse

Constructor Details

#initialize(violations, options = {}) ⇒ JsonFormatter

Returns a new instance of JsonFormatter.



8
9
10
# File 'lib/cane/json_formatter.rb', line 8

def initialize(violations, options = {})
  @violations = violations
end

Instance Method Details

#to_sObject



12
13
14
# File 'lib/cane/json_formatter.rb', line 12

def to_s
  @violations.to_json
end