title: `map!': private method called for String (NoMethodError)
body: <p>I tried to write a private function that will take in a single token and return the given token without white space or punctuation, for example:</p>
  
  <pre><code>normalize_token(" cat.")
  # =&gt; "cat"
  </code></pre>
  
  <p>I then defined an array of tokens that have punctuation and white space:</p>
  
  <pre><code>["a.", "      b...."]
  </code></pre>
  
  <p>which I'd like to map over using my defined function. I expect a new object returned, which looks like:</p>
  
  <pre><code>["a", "b"]
  </code></pre>
  
  <p>Here is a small snippet of code:</p>
  
  <pre><code>private def normalize_token(token)
    token.gsub(/\W/, ' ') # does the same thing as [^A-Za-z0-9_]
  end
  
  ["a.", "      b...."].map!(&amp;:normalize_token)
  </code></pre>
  
  <p>I get:</p>
  
  <blockquote>
    <p><code>map!': private method</code>normalize_token' called for "a.":String
    (NoMethodError)</p>
  </blockquote>
  
  <p>Any help or even an explanation of what I'm doing wrong would be greatly appreciated.</p>