Class: Solargraph::Source::Chain::Head

Inherits:
Link
  • Object
show all
Defined in:
lib/solargraph/source/chain/head.rb

Overview

Note:

Chain::Head is only intended to handle ‘self` and `super`.

Chain::Head is a link for ambiguous words, e.g.; ‘String` can refer to either a class (`String`) or a function (`Kernel#String`).

Instance Attribute Summary

Attributes inherited from Link

#word

Instance Method Summary collapse

Methods inherited from Link

#==, #constant?, #initialize, #undefined?

Constructor Details

This class inherits a constructor from Solargraph::Source::Chain::Link

Instance Method Details

#resolve(api_map, name_pin, locals) ⇒ Object



9
10
11
12
13
# File 'lib/solargraph/source/chain/head.rb', line 9

def resolve api_map, name_pin, locals
  return [self_pin(name_pin.context)] if word == 'self'
  return super_pins(api_map, name_pin) if word == 'super'
  []
end