Implement bag in Ruby