Class: Cogger::Formatters::JSON
- Defined in:
- lib/cogger/formatters/json.rb
Overview
Formats as JSON output.
Constant Summary collapse
- TEMPLATE =
nil
Constants inherited from Abstract
Abstract::NEW_LINE, Abstract::SANITIZERS
Instance Method Summary collapse
- #call(*input) ⇒ Object
-
#initialize(template = TEMPLATE, parser: Parsers::Position.new) ⇒ JSON
constructor
A new instance of JSON.
Constructor Details
Instance Method Details
#call(*input) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/cogger/formatters/json.rb', line 18 def call(*input) *, entry = input attributes = sanitize(entry, :tagged_attributes).tap(&:compact!) parser.call(template, attributes).to_json << NEW_LINE end |