Commit 55457b2c authored by Bob Van Landuyt's avatar Bob Van Landuyt

Make Gitlab::GlRepository#types an instance method

Having this as an instance method makes it easier to override in the
prepended `EE` module.

If we try to override this method on the module itself, it would not
be overridden correctly, depending on the load order.
parent a96e96d5
# frozen_string_literal: true
module Gitlab
module GlRepository
class GlRepository
include Singleton
PROJECT = RepoType.new(
name: :project,
access_checker_class: Gitlab::GitAccess,
......@@ -19,7 +21,7 @@ module Gitlab
}.freeze
def self.types
TYPES
instance.types
end
def self.parse(gl_repository)
......@@ -39,5 +41,11 @@ module Gitlab
def self.default_type
PROJECT
end
def types
TYPES
end
private_class_method :instance
end
end
# frozen_string_literal: true
module Gitlab
module GlRepository
class GlRepository
class RepoType
attr_reader :name,
:access_checker_class,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment