debian-mirror-gitlab/app/serializers/import/provider_repo_serializer.rb
2020-10-24 23:57:45 +05:30

25 lines
656 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
when :manifest
Import::ManifestProviderRepoEntity
else
raise NotImplementedError
end
super(repo, opts, entity)
end
end