Class: Solargraph::Source::Chain::InstanceVariable
- Defined in:
- lib/solargraph/source/chain/instance_variable.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, node, location) ⇒ InstanceVariable
constructor
A new instance of InstanceVariable.
- #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, node, location) ⇒ InstanceVariable
Returns a new instance of InstanceVariable.
10 11 12 13 14 |
# File 'lib/solargraph/source/chain/instance_variable.rb', line 10 def initialize word, node, location super(word) @node = node @location = location end |
Instance Method Details
#resolve(api_map, name_pin, locals) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/solargraph/source/chain/instance_variable.rb', line 16 def resolve api_map, name_pin, locals ivars = api_map.get_instance_variable_pins(name_pin.context.namespace, name_pin.context.scope).select do |p| p.name == word end out = api_map.var_at_location(ivars, word, name_pin, location) [out].compact end |