Module: DPL::Provider::Heroku

Extended by:
Heroku
Included in:
Heroku
Defined in:
lib/dpl/provider/heroku.rb,
lib/dpl/provider/heroku/api.rb,
lib/dpl/provider/heroku/git.rb,
lib/dpl/provider/heroku/generic.rb

Defined Under Namespace

Classes: API, Generic, Git

Instance Method Summary collapse

Instance Method Details

#new(context, options) ⇒ Object

Raises:

  • (Error)


14
15
16
17
18
19
# File 'lib/dpl/provider/heroku.rb', line 14

def new(context, options)
  strategy = options[:strategy] || 'api'
  constant = constants.detect { |c| c.to_s.downcase == strategy.downcase.gsub(/\W/, '') }
  raise Error, 'unknown strategy %p' % strategy unless constant and constant != Generic
  const_get(constant).new(context, options)
end