16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/pry-sorbet/commands/unwrap_command.rb', line 16
def process
return unless defined?(T::Private::Methods)
sig_wrappers = T::Private::Methods.instance_variable_get(:@sig_wrappers) || {}
sig_wrappers.values.each do |sig_wrapper|
sig_wrapper.call
rescue NameError
end
signatures_by_method = T::Private::Methods.instance_variable_get(:@signatures_by_method) || {}
signatures_by_method.values.each do |signature|
T::Configuration.without_ruby_warnings do
T::Private::DeclState.current.without_on_method_added do
if signature.mode == T::Private::Methods::Modes.abstract
signature.owner.send(:remove_method, signature.method_name)
else
signature.owner.send(:define_method, signature.method_name, signature.method)
end
end
end
end
end
|