require 'universal-git-client/normalizers/base' module UniversalGitClient module Normalizers class Gitlab < Base class UserSerializer < BaseSerializer attribute :login, &:username attributes :name, :avatar_url end class OrganizationSerializer < BaseSerializer attributes :avatar_url attribute :login, &:full_path end class RepositorySerializer < BaseSerializer attributes :name, :archived, :default_branch attribute :full_name, &:path_with_namespace attribute :full_path, &:path_with_namespace attribute :private do |object| case object.visibility when 'private' true else false end end end class BranchSerializer < BaseSerializer set_id :name attributes :name, :protected attribute :commit do |object| object.commit.id end end class WebhookSerializer < BaseSerializer attributes :url attribute(:active) { true } attribute(:type) { 'Repository' } attribute :events do |object| events = [] events << 'push' if object.push_events events end end end end end