Class: Loadmop::Loader

Inherits:
Object
  • Object
show all
Includes:
Sequelizer
Defined in:
lib/loadmop/loader.rb

Direct Known Subclasses

CDMv4Loader, VocabLoader

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data_files_dir, options = {}) ⇒ Loader

Returns a new instance of Loader.



11
12
13
14
15
# File 'lib/loadmop/loader.rb', line 11

def initialize(data_files_dir, options = {})
  @data_files_dir = Pathname.new(data_files_dir)
  @options = options
  @headers = {}
end

Instance Attribute Details

#data_files_dirObject (readonly)

Returns the value of attribute data_files_dir.



9
10
11
# File 'lib/loadmop/loader.rb', line 9

def data_files_dir
  @data_files_dir
end

#headersObject (readonly)

Returns the value of attribute headers.



9
10
11
# File 'lib/loadmop/loader.rb', line 9

def headers
  @headers
end

#optionsObject (readonly)

Returns the value of attribute options.



9
10
11
# File 'lib/loadmop/loader.rb', line 9

def options
  @options
end

Instance Method Details

#create_databaseObject



17
18
19
20
21
# File 'lib/loadmop/loader.rb', line 17

def create_database
  create_tables
  load_files
  create_indexes
end