Module: CLI::Kit::Opts::Mixin::MixinClassMethods

Extended by:
T::Sig
Defined in:
lib/cli/kit/opts.rb

Instance Method Summary collapse

Methods included from T::Sig

sig

Instance Method Details

#include(included_module) ⇒ Object



18
19
20
21
22
23
# File 'lib/cli/kit/opts.rb', line 18

def include(included_module)
  super
  return unless included_module.is_a?(MixinClassMethods)

  included_module.tracked_methods.each { |m| track_method(m) }
end

#method_added(method_name) ⇒ Object

No signature - Sorbet uses method_added internally, so can’t verify it



26
27
28
29
# File 'lib/cli/kit/opts.rb', line 26

def method_added(method_name) # rubocop:disable Sorbet/EnforceSignatures
  super
  track_method(method_name)
end

#track_method(method_name) ⇒ Object



32
33
34
35
# File 'lib/cli/kit/opts.rb', line 32

def track_method(method_name)
  @tracked_methods ||= []
  @tracked_methods << method_name unless @tracked_methods.include?(method_name)
end

#tracked_methodsObject



38
39
40
# File 'lib/cli/kit/opts.rb', line 38

def tracked_methods
  @tracked_methods || []
end