Class: RailsDoctor::Reporters::Json
- Inherits:
-
Object
- Object
- RailsDoctor::Reporters::Json
- Defined in:
- lib/rails_doctor/reporters/json.rb
Instance Method Summary collapse
-
#initialize(result, include_raw: false) ⇒ Json
constructor
A new instance of Json.
- #render ⇒ Object
Constructor Details
#initialize(result, include_raw: false) ⇒ Json
Returns a new instance of Json.
8 9 10 11 |
# File 'lib/rails_doctor/reporters/json.rb', line 8 def initialize(result, include_raw: false) @result = result @include_raw = include_raw end |
Instance Method Details
#render ⇒ Object
13 14 15 |
# File 'lib/rails_doctor/reporters/json.rb', line 13 def render JSON.pretty_generate(@result.to_h(include_raw: @include_raw)) + "\n" end |