Class: Solargraph::Parser::Rubyvm::NodeProcessors::SclassNode

Inherits:
NodeProcessor::Base show all
Defined in:
lib/solargraph/parser/rubyvm/node_processors/sclass_node.rb

Instance Attribute Summary

Attributes inherited from NodeProcessor::Base

#locals, #node, #pins, #region

Instance Method Summary collapse

Methods inherited from NodeProcessor::Base

#initialize

Constructor Details

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

Instance Method Details

#processObject



8
9
10
11
12
13
14
15
16
# File 'lib/solargraph/parser/rubyvm/node_processors/sclass_node.rb', line 8

def process
  # @todo Temporarily skipping remote metaclasses
  return unless node.children[0].is_a?(RubyVM::AbstractSyntaxTree::Node) && node.children[0].type == :SELF
  pins.push Solargraph::Pin::Singleton.new(
    location: get_node_location(node),
    closure: region.closure
  )
  process_children region.update(visibility: :public, scope: :class, closure: pins.last)
end