Class: Solargraph::Source::Chain::Call
- Inherits:
-
Link
- Object
- Link
- Solargraph::Source::Chain::Call
show all
- Defined in:
- lib/solargraph/source/chain/call.rb
Instance Attribute Summary collapse
Attributes inherited from Link
#last_context
Instance Method Summary
collapse
Methods inherited from Link
#==, #clone_body, #clone_head, #constant?, #head?, #nullable?, #undefined?
Constructor Details
#initialize(word, arguments = [], with_block = false) ⇒ Call
Returns a new instance of Call.
17
18
19
20
21
|
# File 'lib/solargraph/source/chain/call.rb', line 17
def initialize word, arguments = [], with_block = false
@word = word
@arguments = arguments
@with_block = with_block
end
|
Instance Attribute Details
#arguments ⇒ Array<Chain>
11
12
13
|
# File 'lib/solargraph/source/chain/call.rb', line 11
def arguments
@arguments
end
|
#word ⇒ String
8
9
10
|
# File 'lib/solargraph/source/chain/call.rb', line 8
def word
@word
end
|
Instance Method Details
#resolve(api_map, name_pin, locals) ⇒ Object
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
# File 'lib/solargraph/source/chain/call.rb', line 30
def resolve api_map, name_pin, locals
return super_pins(api_map, name_pin) if word == 'super'
found = if head?
locals.select { |p| p.name == word }
else
[]
end
return inferred_pins(found, api_map, name_pin.context, locals) unless found.empty?
pins = name_pin.binder.each_unique_type.flat_map do |context|
api_map.get_method_stack(context.namespace, word, scope: context.scope)
end
return [] if pins.empty?
inferred_pins(pins, api_map, name_pin.context, locals)
end
|
#with_block? ⇒ Boolean
23
24
25
|
# File 'lib/solargraph/source/chain/call.rb', line 23
def with_block?
@with_block
end
|