9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/solargraph/yard_map/mapper/to_method.rb', line 9
def self.make code_object, name = nil, scope = nil, visibility = nil, closure = nil, spec = nil
closure ||= Solargraph::Pin::Namespace.new(
name: code_object.namespace.to_s,
gates: [code_object.namespace.to_s]
)
location = object_location(code_object, spec)
= code_object.docstring ? code_object.docstring.all.to_s : ''
pin = Pin::Method.new(
location: location,
closure: closure,
name: name || code_object.name.to_s,
comments: ,
scope: scope || code_object.scope,
visibility: visibility || code_object.visibility,
parameters: [],
explicit: code_object.is_explicit?
)
pin.parameters.concat get_parameters(code_object, location, , pin)
pin
end
|