Class: Tree::TreeNode

Inherits:
Object show all
Defined in:
lib/not_naughty/error_handler.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#closest(obj) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/not_naughty/error_handler.rb', line 4

def closest(obj)
  if @name == obj then self
  elsif @name > obj
    closest = self
    @children.any? { |child| node = child.closest(obj) and closest = node }

    closest
  end
end