Module: Relaton::Cli::DataFetcher

Extended by:
DataFetcher
Included in:
DataFetcher
Defined in:
lib/relaton/cli/data_fetcher.rb

Instance Method Summary collapse

Instance Method Details

#fetch(source, options) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/relaton/cli/data_fetcher.rb', line 4

def fetch(source, options)
  processor = Relaton::Registry.instance.find_processor_by_dataset source
  unless processor
    Util.warn "WARNING: no processor found for `#{source}`"
    return
  end

  opts = {}
  opts[:output] = options[:output] if options[:output]
  opts[:format] = options[:format] if options[:format]
  processor.fetch_data source, opts
end