Module: TreeTraversal

Defined in:
lib/glue/tree.rb

Overview

A useful encapsulation of the nested intervals pattern for hierarchical SQL queries. Slightly adapted from the original article (www.dbazine.com/tropashko4.shtml)

Class Method Summary collapse

Class Method Details

.child(sum, n) ⇒ Object



17
18
19
20
# File 'lib/glue/tree.rb', line 17

def self.child(sum, n)
  power = 2 ** n
  return sum * power
end