lib/haml_lint/tree/node.rb
# Returns the node that follows this node, whether it be a sibling or an
# ancestor's child, but not a child of this node.
#
# If you are also willing to return the child, call {#next_node}.
#
# Returns nil if there is no successor.
#
# @return [HamlLint::Tree::Node,nil]
Returns the node that follows this node, whether it be a sibling or an
ancestor's child, but not a child of this node.

If you are also willing to return the child, call {#next_node}.

Returns nil if there is no successor.
Returns the node that follows this node whether it be a sibling or an ancestor ' s child but not a child of this node . If you are also willing to return the child call { #next_node } . Returns nil if there is no successor .
def successor
      siblings = parent ? parent.children : [self]
      next_sibling = siblings[siblings.index(self) + 1] if siblings.count > 1
      return next_sibling if next_sibling
      parent.successor if parent
    end
def successor siblings = parent ? parent . children : [ self ] next_sibling = siblings [ siblings . index ( self ) + 1 ] if siblings . count > 1 return next_sibling if next_sibling parent . successor if parent end
Returns the node that follows this node, whether it be a sibling or an
ancestor's child, but not a child of this node.
Returns the node that follows this node whether it be a sibling or an ancestor ' s child but not a child of this node .
None
HamlLint::Tree::Node,nil