Class: Tb::NDJSONWriter
- Inherits:
-
HashWriter
- Object
- HashWriter
- Tb::NDJSONWriter
- Defined in:
- lib/tb/ndjson.rb
Instance Method Summary collapse
-
#initialize(io) ⇒ NDJSONWriter
constructor
A new instance of NDJSONWriter.
Methods inherited from HashWriter
#finish, #header_generator=, #header_required?, #put_hash
Constructor Details
#initialize(io) ⇒ NDJSONWriter
Returns a new instance of NDJSONWriter.
57 58 59 60 61 |
# File 'lib/tb/ndjson.rb', line 57 def initialize(io) super lambda {|hash| io << (JSON.generate(hash) + "\n") } end |