lib/rails/graphql/request.rb
def import_extensions(*modules)
          modules.each do |mod|
            mod.constants.each do |const_name|
              const_name = const_name.to_s
              const = mod.const_get(const_name)
              next unless const.is_a?(Module)

              # Find the related request class to extend
              klass = const_name === 'Request' ? self.class : begin
                const_name.split('_').inject(self.class) do |k, next_const|
                  k.const_defined?(next_const) ? k.const_get(next_const) : break
                end
              end

              # Create the shared module and include the extension
              next unless klass&.is_a?(Class)
              extensions[klass] ||= Module.new
              extensions[klass].include(const)
            end
          end
        end
# Find all necessary extensions inside the given +modules+ and prepare
# the extension base module
Find all necessary extensions inside the given +modules+ and prepare
the extension base module
Find all necessary extensions inside the given + modules + and prepare the extension base module
def import_extensions(*modules)
          modules.each do |mod|
            mod.constants.each do |const_name|
              const_name = const_name.to_s
              const = mod.const_get(const_name)
              next unless const.is_a?(Module)
              klass = const_name === 'Request' ? self.class : begin
                const_name.split('_').inject(self.class) do |k, next_const|
                  k.const_defined?(next_const) ? k.const_get(next_const) : break
                end
              end
              next unless klass&.is_a?(Class)
              extensions[klass] ||= Module.new
              extensions[klass].include(const)
            end
          end
        end
def import_extensions ( * modules ) modules . each do | mod | mod . constants . each do | const_name | const_name = const_name . to_s const = mod . const_get ( const_name ) next unless const . is_a? ( Module ) klass = const_name === 'Request' ? self . class : begin const_name . split ( '_' ) . inject ( self . class ) do | k , next_const | k . const_defined? ( next_const ) ? k . const_get ( next_const ) : break end end next unless klass &. is_a? ( Class ) extensions [ klass ] ||= Module . new extensions [ klass ] . include ( const ) end end end
Find all necessary extensions inside the given +modules+ and prepare
the extension base module
Find all necessary extensions inside the given + modules + and prepare the extension base module
# Find the related request class to extend # Create the shared module and include the extension
modules