Class: HealthRack::Renderers::JSONRenderer

Inherits:
Object
  • Object
show all
Defined in:
lib/health_rack/renderers/json_renderer.rb

Constant Summary collapse

CONTENT_TYPE =
"application/json"

Instance Method Summary collapse

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_typeObject



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