search for: array_of_self

Displaying 1 result from an estimated 1 matches for "array_of_self".

2008 Oct 30
2
Rails console
...n/Code/green_green_client_application $ ./script/console Loading development environment (Rails 2.1.2) >> [1,2,3].choose_randomly NoMethodError: undefined method `choose_randomly'' for [1, 2, 3]:Array from (irb):1 >> module Enumerable >> def choose_randomly >> array_of_self = Array( self ) >> index = rand( array_of_self.size ) >> array_of_self[ index ] >> end >> end => nil >> [1,2,3].choose_randomly ArgumentError: wrong number of arguments (1 for 0) from (irb):5:in `rand'' from (irb):5:in `choose_randomly''...