title: How to sort numbers from smallest to largest in Ruby
body: <p>I am trying to sort my array of numbers from smallest to largest WITHOUT using the built-in <code>sort()</code> method. </p>
  
  <p>Here's what I have:</p>
  
  <pre><code>def sort my_numbers
    new_array = []
    my_numbers.each() do | number|
      first = new_array.push(my_numbers.min)
      last = new_array.push(my_numbers.max)
      range_of_numbers = (first..last)
  
      if range_of_numbers.include?(number)
        new_array.push(number)
      end
      return new_array
    end
  end
  
  
  puts sort([5, 9, 2, 5, 2])
  </code></pre>
  
  <p>This gives me <code>[2, 9]</code> but I want those middle numbers too. I tried using a range from my first and last numbers in my array and comparing that range with my array to see if it contained numbers from my array.</p>