Class: EagerEye::Reporters::Json
- Defined in:
- lib/eager_eye/reporters/json.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(issues, pretty: false) ⇒ Json
constructor
A new instance of Json.
- #report ⇒ Object
Constructor Details
#initialize(issues, pretty: false) ⇒ Json
Returns a new instance of Json.
8 9 10 11 |
# File 'lib/eager_eye/reporters/json.rb', line 8 def initialize(issues, pretty: false) super(issues) @pretty = pretty end |
Instance Method Details
#report ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/eager_eye/reporters/json.rb', line 13 def report result = { summary: summary_hash, issues: issues.map(&:to_h) } @pretty ? JSON.pretty_generate(result) : JSON.generate(result) end |