title: Undefined method sort for Enumerator
body: <p>I implemented the Greedy algorithim in ruby using the following code: </p>
  
  <pre><code>class Greedy
    def initialize(unit, total, *coins)
      @total_coins1 = 0
      @total_coins2 = 0
      @unit = unit
      @total = total
      @reset_total = total
      @currency = coins.map 
      @currency.sort!
      @currency = @currency.reverse
      unless @currency.include?(1)
        @currency.push(1)
      end
    end
    def sorter
      @currency.each do |x|
        @pos = @total / x
        @pos = @pos.floor
        @total_coins1 += @pos
        @total -= x * @pos
        puts "#{@pos}: #{x} #{@unit}"
      end
      puts "#{@total_coins1} total coins"
    end
  end
  </code></pre>
  
  <p>When I try to run the code:</p>
  
  <pre><code>x = Greedy.new("cents", 130, 50, 25, 10, 5)
  </code></pre>
  
  <p>I get an error:</p>
  
  <pre><code>NoMethodError: undefined method `sort!' for #&lt;Enumerator: [50, 25, 10, 5]:map&gt;
      from /Users/Solomon/Desktop/Ruby/greedy.rb:9:in `initialize'
      from (irb):2:in `new'
      from (irb):2
      from /Users/Solomon/.rvm/rubies/ruby-1.9.3-p125/bin/irb:16:in `&lt;main&gt;'
  </code></pre>
  
  <p>Being very new to Ruby, I have no idea what this means, nor how to fix it, because <code>[50, 25, 10, 5].sort!</code> is a perfectly valid method... How do I fix this error?</p>