Class: Vedeu::Renderers::JSON
- Includes:
- Options
- Defined in:
- lib/vedeu/renderers/json.rb
Overview
Renders a Buffers::Terminal as JSON.
Instance Attribute Summary
Attributes included from Options
Instance Method Summary collapse
- #as_hash ⇒ Array private
-
#clear ⇒ Hash
Render a cleared output.
- #content ⇒ String private
Methods included from Options
#compression, #compression?, #default_template, #defaults, #end_row_tag, #end_tag, #filename, #initialize, #output, #output?, #render, #start_row_tag, #start_tag, #template, #timestamp, #timestamp?, #write, #write_file, #write_file?
Methods included from Common
#absent?, #array?, #boolean, #boolean?, #empty_value?, #escape?, #falsy?, #hash?, #line_model?, #numeric?, #positionable?, #present?, #snake_case, #stream_model?, #string?, #symbol?, #truthy?, #view_model?
Methods inherited from File
Instance Method Details
#as_hash ⇒ Array (private)
23 24 25 |
# File 'lib/vedeu/renderers/json.rb', line 23 def as_hash output.content.map(&:to_h) end |
#clear ⇒ Hash
Render a cleared output.
16 17 18 |
# File 'lib/vedeu/renderers/json.rb', line 16 def clear render({}) end |