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
15 16 17 18 |
# File 'lib/glue/tree.rb', line 15 def self.child(sum, n) power = 2 ** n return sum * power end |