Class: HealthRack::Renderers::JSONRenderer
- Inherits:
-
Object
- Object
- HealthRack::Renderers::JSONRenderer
- Defined in:
- lib/health_rack/renderers/json_renderer.rb
Constant Summary collapse
- CONTENT_TYPE =
"application/json"
Instance Method Summary collapse
- #content_type ⇒ Object
-
#initialize(app) ⇒ JSONRenderer
constructor
A new instance of JSONRenderer.
- #render(buffer) ⇒ Object
Constructor Details
#initialize(app) ⇒ JSONRenderer
Returns a new instance of JSONRenderer.
8 9 10 |
# File 'lib/health_rack/renderers/json_renderer.rb', line 8 def initialize(app) @app = app end |
Instance Method Details
#content_type ⇒ Object
12 13 14 |
# File 'lib/health_rack/renderers/json_renderer.rb', line 12 def content_type CONTENT_TYPE end |
#render(buffer) ⇒ Object
16 17 18 |
# File 'lib/health_rack/renderers/json_renderer.rb', line 16 def render(buffer) buffer.write(json) end |