Class: Ronin::Core::OutputFormats::NDJSON

Inherits:
OutputFile show all
Defined in:
lib/ronin/core/output_formats/ndjson.rb

Overview

Represents a newline deliminated JSON (.ndjson) output format.

Since:

  • 0.2.0

Instance Attribute Summary

Attributes inherited from OutputFile

#io

Instance Method Summary collapse

Methods inherited from OutputFile

#close, #initialize, open

Constructor Details

This class inherits a constructor from Ronin::Core::OutputFormats::OutputFile

Instance Method Details

#<<(value) ⇒ self

Appends a value to the NDJSON stream.

Parameters:

  • value (#to_json)

    The value to append.

Returns:

  • (self)

Raises:

  • (NotImplementedError)

    The given value object does not define a to_json method.

Since:

  • 0.2.0



46
47
48
49
50
# File 'lib/ronin/core/output_formats/ndjson.rb', line 46

def <<(value)
  @io.puts(value.to_json)
  @io.flush
  return self
end