Class: Cane::JsonFormatter
- Inherits:
-
Object
- Object
- Cane::JsonFormatter
- 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
-
#initialize(violations) ⇒ JsonFormatter
constructor
A new instance of JsonFormatter.
- #to_s ⇒ Object
Constructor Details
#initialize(violations) ⇒ JsonFormatter
Returns a new instance of JsonFormatter.
8 9 10 |
# File 'lib/cane/json_formatter.rb', line 8 def initialize(violations) @violations = violations end |
Instance Method Details
#to_s ⇒ Object
12 13 14 |
# File 'lib/cane/json_formatter.rb', line 12 def to_s @violations.to_json end |