class Solargraph::Parser::Rubyvm::NodeProcessors::BlockNode
Public Instance Methods
process()
click to toggle source
# File lib/solargraph/parser/rubyvm/node_processors/block_node.rb, line 9 def process location = get_node_location(node) parent = if other_class_eval? Solargraph::Pin::Namespace.new( location: location, type: :class, name: unpack_name(node.children[0].children[0]) ) else region.closure end pins.push Solargraph::Pin::Block.new( location: location, closure: parent, receiver: node.children[0], comments: comments_for(node), scope: region.scope || region.closure.context.scope ) process_children region.update(closure: pins.last) end
Private Instance Methods
other_class_eval?()
click to toggle source
# File lib/solargraph/parser/rubyvm/node_processors/block_node.rb, line 32 def other_class_eval? node.children[0].type == :CALL && node.children[0].children[1] == :class_eval && [:COLON2, :CONST].include?(node.children[0].children[0].type) end