Data Structure Implementation in Ruby