Class: Solargraph::Source::Chain::Constant
- Defined in:
- lib/solargraph/source/chain/constant.rb
Constant Summary
Constants included from Logging
Logging::DEFAULT_LOG_LEVEL, Logging::LOG_LEVELS
Instance Attribute Summary
Attributes inherited from Link
Instance Method Summary collapse
-
#initialize(word) ⇒ Constant
constructor
A new instance of Constant.
- #resolve(api_map, name_pin, locals) ⇒ Object
Methods inherited from Link
#clone_body, #clone_head, #constant?, #desc, #head?, #inspect, #nullable?, #to_s, #undefined?
Methods included from Logging
Methods included from Equality
#==, #eql?, #equality_fields, #freeze, #hash
Constructor Details
#initialize(word) ⇒ Constant
7 8 9 |
# File 'lib/solargraph/source/chain/constant.rb', line 7 def initialize word @word = word end |
Instance Method Details
#resolve(api_map, name_pin, locals) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/solargraph/source/chain/constant.rb', line 11 def resolve api_map, name_pin, locals return [Pin::ROOT_PIN] if word.empty? if word.start_with?('::') base = word[2..-1] gates = [''] else base = word gates = name_pin.gates end fqns = api_map.resolve(base, gates) api_map.get_path_pins(fqns) end |