Class: Datahen::Scraper::Finisher

Inherits:
Object
  • Object
show all
Defined in:
lib/datahen/scraper/finisher.rb

Class Method Summary collapse

Class Method Details

.exec_finisher(filename, job_id = nil, save = false) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/datahen/scraper/finisher.rb', line 5

def self.exec_finisher(filename, job_id=nil, save=false)
  extname = File.extname(filename)
  case extname
  when '.rb'
    executor = RubyFinisherExecutor.new(filename: filename, job_id: job_id)
    executor.exec_finisher(save)
  else
    puts "Unable to find a finisher executor for file type \"#{extname}\""
  end
end