class YARD::Parser::Ruby::AstNode

def jump(*node_types)

Returns:
  • (self) - if no node was found
  • (AstNode) - the matching node, if one was found

Parameters:
  • node_types (Array) -- a set of node types to match

Other tags:
    Example: If the node types are not present in the AST -
    Example: Returns first 'def' or 'class' statement -
    Example: Returns the first method definition in a block of code -
def jump(*node_types)
  traverse {|child| return(child) if node_types.include?(child.type) }
  self
end