Module: DataImp::ImportMethods

Included in:
DataImp
Defined in:
lib/data_imp/import_methods.rb

Instance Method Summary collapse

Instance Method Details

#import(*files, **options, &block) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/data_imp/import_methods.rb', line 7

def import(*files, **options, &block)
  files.flatten.each do |file|
    file.strip!
    unless file =~ /^#/
      new(file, **options, &block).import
    end
  end
end

#import_list(*lists, **options, &block) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/data_imp/import_methods.rb', line 16

def import_list(*lists, **options, &block)
  lists.flatten.each do |list|
    list.each_line do |file|
      import file, **options, &block
    end
  end
end