Example code for recursion in Ruby