Refactored bob.rb with custom string type