Class: Wukong::Load::Loader

Inherits:
Processor::FromJson
  • Object
show all
Defined in:
lib/wukong-load/loader.rb

Overview

Base class from which to build Loaders.

Instance Method Summary collapse

Instance Method Details

#load(record) ⇒ Object

Override this method to load a record into the data store.

Parameters:

  • record (Hash)


18
19
# File 'lib/wukong-load/loader.rb', line 18

def load record
end

#process(line) ⇒ Object

Calls super() to leverage its deserialization and then calls

load on the yielded record.

Parameters:

  • line (String)

    JSON to parse.



11
12
13
# File 'lib/wukong-load/loader.rb', line 11

def process line
  super(line) { |record| load(record) }
end