PageRenderTime 42ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/lib/gitpusher/service/factory.rb

https://bitbucket.org/KitaitiMakoto/gitpusher
Ruby | 14 lines | 14 code | 0 blank | 0 comment | 0 complexity | 67bd5b6d804c0d9c2a5a582f5c6aec85 MD5 | raw file
  1. module GitPusher
  2. module Service
  3. class Factory
  4. def self.create(config)
  5. case config[:type]
  6. when /github/i then GitPusher::Service::GitHub.new(config)
  7. when /bitbucket/i then GitPusher::Service::BitBucket.new(config)
  8. else
  9. raise "unknown service type : #{config[:type]}"
  10. end
  11. end
  12. end
  13. end
  14. end