Class: FlatKit::Jsonl::Format

Inherits:
Format
  • Object
show all
Defined in:
lib/flat_kit/jsonl/format.rb

Overview

Internal: JSONL format class holding the metadata about the JSONL format

Class Method Summary collapse

Methods inherited from Format

for, for_with_fallback, for_with_fallback!, #format_name

Methods included from DescendantTracker

#children, #find_child, #find_children, #inherited

Class Method Details

.format_nameObject



8
9
10
# File 'lib/flat_kit/jsonl/format.rb', line 8

def self.format_name
  "jsonl"
end

.handles?(filename) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
15
16
17
18
# File 'lib/flat_kit/jsonl/format.rb', line 12

def self.handles?(filename)
  parts = filename.split(".")
  %w[json jsonl ndjson].each do |ext|
    return true if parts.include?(ext)
  end
  false
end

.readerObject



20
21
22
# File 'lib/flat_kit/jsonl/format.rb', line 20

def self.reader
  ::FlatKit::Jsonl::Reader
end

.writerObject



24
25
26
# File 'lib/flat_kit/jsonl/format.rb', line 24

def self.writer
  ::FlatKit::Jsonl::Writer
end