Class: Import::ProviderRepoSerializer

Inherits:
BaseSerializer show all
Defined in:
app/serializers/import/provider_repo_serializer.rb

Instance Attribute Summary

Attributes inherited from BaseSerializer

#params

Instance Method Summary collapse

Methods inherited from BaseSerializer

entity, #initialize

Constructor Details

This class inherits a constructor from BaseSerializer

Instance Method Details

#represent(repo, opts = {}) ⇒ Object


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/serializers/import/provider_repo_serializer.rb', line 4

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