class RailsRouteChecker::Parsers::HamlParser::Tree::Node::Siblings

Public Instance Methods

next(node) click to toggle source
# File lib/rails-route-checker/parsers/haml_parser/tree/node.rb, line 95
def next(node)
  subsequents(node).first
end
previous(node) click to toggle source
# File lib/rails-route-checker/parsers/haml_parser/tree/node.rb, line 99
def previous(node)
  priors(node).last
end
priors(node) click to toggle source
# File lib/rails-route-checker/parsers/haml_parser/tree/node.rb, line 103
def priors(node)
  position = position(node)
  if position.zero?
    []
  else
    siblings[0..(position - 1)]
  end
end
subsequents(node) click to toggle source
# File lib/rails-route-checker/parsers/haml_parser/tree/node.rb, line 112
def subsequents(node)
  siblings[(position(node) + 1)..-1]
end

Private Instance Methods

position(node) click to toggle source
# File lib/rails-route-checker/parsers/haml_parser/tree/node.rb, line 120
def position(node)
  siblings.index(node)
end