module Lolita module Navigation class Tree include Enumerable include Lolita::Hooks class<self)) else branch[0].tree=self branch[0] end end def put_in_branches branch,index before_part=@branches.slice(0,index+1) || [] after_part=@branches.slice(index+1,@branches.size-index) || [] @branches=before_part+[branch]+after_part end end end end