Class: PredictabilityEngine::DataSources::Factory

Inherits:
Object
  • Object
show all
Defined in:
lib/predictability_engine/data_sources/factory.rb

Class Method Summary collapse

Class Method Details

.for(spec, **opts) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/predictability_engine/data_sources/factory.rb', line 6

def self.for(spec, **opts)
  source = case spec
           when /^jira:/, /^jql:/, /\.yml$/, /\.yaml$/, 'jira', /^[A-Z][A-Z0-9]+$/
             Jira.new
           when /\.xlsx$/
             Excel.new
           else
             Csv.new
           end
  source.configure(opts)
  source
end