Or perhaps clearer:

  def remove_spaces
    name.strip!
  end

If there's any chance that name could actually be nil, then

  def remove_spaces
    name.strip! if name
  end
-- 
Posted via http://www.ruby-forum.com/.