Class: Solargraph::Parser::Rubyvm::NodeProcessors::SendNode

Inherits:
NodeProcessor::Base show all
Includes:
Solargraph::Parser::Rubyvm::NodeMethods
Defined in:
lib/solargraph/parser/rubyvm/node_processors/send_node.rb

Instance Attribute Summary

Attributes inherited from NodeProcessor::Base

#locals, #node, #pins, #region

Instance Method Summary collapse

Methods included from Solargraph::Parser::Rubyvm::NodeMethods

any_splatted_call?, call_nodes_from, const_nodes_from, convert_hash, find_recipient_node, infer_literal_node_type, node?, pack_name, returns_from, splatted_call?, splatted_hash?, splatted_node?, unpack_name

Methods inherited from NodeProcessor::Base

#initialize

Constructor Details

This class inherits a constructor from Solargraph::Parser::NodeProcessor::Base

Instance Method Details

#processObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/solargraph/parser/rubyvm/node_processors/send_node.rb', line 10

def process
  if [:private, :public, :protected].include?(node.children[0])
    process_visibility
  elsif node.children[0] == :module_function
    process_module_function
  elsif node.children[0] == :require
    process_require
  elsif node.children[0] == :autoload
    process_autoload
  elsif node.children[0] == :alias_method
    process_alias_method
  elsif node.children[0] == :private_class_method
    process_private_class_method
  elsif [:attr_reader, :attr_writer, :attr_accessor].include?(node.children[0])
    process_attribute
  elsif node.children[0] == :include
    process_include
  elsif node.children[0] == :extend
    process_extend
  elsif node.children[0] == :prepend
    process_prepend
  elsif node.children[0] == :private_constant
    process_private_constant
  elsif node.children[1] == :require && unpack_name(node.children[0]) == 'Bundler'
    pins.push Pin::Reference::Require.new(Solargraph::Location.new(region.filename, Solargraph::Range.from_to(0, 0, 0, 0)), 'bundler/require')
  end
  process_children
end