4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/solargraph/arc/patches.rb', line 4
def get_complex_type_methods complex_type, context = '', internal = false
return [] if complex_type.undefined? || complex_type.void?
result = Set.new
complex_type.each do |type|
if type.duck_type?
result.add Pin::DuckMethod.new(name: type.to_s[1..-1])
result.merge get_methods('Object')
else
unless type.nil? || type.name == 'void'
visibility = [:public]
if type.namespace == context || super_and_sub?(type.namespace, context)
visibility.push :protected
visibility.push :private if internal
end
result.merge get_methods(type.namespace, scope: type.scope, visibility: visibility)
end
end
end
result.to_a
end
|