debian-mirror-gitlab/app/serializers/import/provider_repo_serializer.rb
2020-06-23 00:09:42 +05:30

23 lines
592 B
Ruby

# frozen_string_literal: true
class Import::ProviderRepoSerializer < BaseSerializer
def represent(repo, opts = {})
entity =
case opts[:provider]
when :fogbugz
Import::FogbugzProviderRepoEntity
when :github, :gitea
Import::GithubishProviderRepoEntity
when :bitbucket
Import::BitbucketProviderRepoEntity
when :bitbucket_server
Import::BitbucketServerProviderRepoEntity
when :gitlab
Import::GitlabProviderRepoEntity
else
raise NotImplementedError
end
super(repo, opts, entity)
end
end