Module: Gitlab::Graphql::DeprecationsBase

Included in:
Gitlab::GlobalId::Deprecations, TypeNameDeprecations
Defined in:
lib/gitlab/graphql/deprecations_base.rb

Overview

include DeprecationsBase at the end of the target module

Defined Under Namespace

Modules: ClassMethods Classes: NameDeprecation

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/gitlab/graphql/deprecations_base.rb', line 9

def self.included(klass)
  klass.extend(ClassMethods)

  klass.const_set(:OLD_GRAPHQL_NAME_MAP, klass::DEPRECATIONS.index_by do |d|
    klass.map_graphql_name(d.old_name)
  end.freeze)
  klass.const_set(:OLD_NAME_MAP, klass::DEPRECATIONS.index_by(&:old_name).freeze)
  klass.const_set(:NEW_NAME_MAP, klass::DEPRECATIONS.index_by(&:new_name).freeze)
end