D3.js's nest operator in Ruby