Class: YARDSorbet::Handlers::MixesInClassMethodsHandler

Inherits:
YARD::Handlers::Ruby::Base
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/yard-sorbet/handlers/mixes_in_class_methods_handler.rb

Overview

Tracks modules that invoke mixes_in_class_methods for use in IncludeHandler

Constant Summary collapse

@@mix_in_class_methods =

rubocop:disable Style/ClassVars

T.let({}, T::Hash[String, T::Array[String]])

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.mixed_in_class_methods(code_obj) ⇒ Array<String>?

Parameters:

  • code_obj (String)

Returns:

  • (Array<String>, nil)


18
# File 'lib/yard-sorbet/handlers/mixes_in_class_methods_handler.rb', line 18

def self.mixed_in_class_methods(code_obj) = @@mix_in_class_methods[code_obj]

Instance Method Details

#processvoid

This method returns an undefined value.



21
22
23
24
# File 'lib/yard-sorbet/handlers/mixes_in_class_methods_handler.rb', line 21

def process
  @@mix_in_class_methods[namespace.to_s] ||= []
  @@mix_in_class_methods.fetch(namespace.to_s) << statement.parameters(false)[0].source
end