title: How to convert every string element inside an array to ascii and store the results in a new array?
body: <p>This is my first post, but I'm trying to perform a method on every element in an array and store the output of each result into a new array. I'm using ascii conversion. Whenever I run this code, I get "undefined method for codepoints for nil:NilClass" Am I using codepoints incorrectly?</p>
  
  <pre><code>def map(array, method)
      result_array = []
  
      array.each do |element|
          value = element.send(method) # Call the method on the object
          result_array.push(value)
      end
  
      return result_array
  end
  
  def method(x_string)
      x_ascii = x_string.codepoints.to_a
      return x_ascii
      ###Need to finish here
  end
  
  Tigers = ['Bengal', 'Asian', 'Burmese', 'Mongolian', 'Cambodian']
  result_array = map(Tigers, method)
  puts result_array
  </code></pre>