On Dec 18, 2006, at 10:08 AM, Andrea Fazzi wrote:

> Hi all,
>
> please consider two files: init.rb and init_2.rb. In init.rb put  
> this bunch of code:
>
> module Foo
>  def init
>    self.methods.collect { |meth| meth if meth =~ / 
> init_/ }.compact.each do |init_meth|
>      self.send(init_meth.to_sym)
>    end
>  end
> end
>
> ...
>
> So, which is the sort criteria of the array returned by  
> Object#methods?
>
> Thanks a lot!
> Andrea

If it's important, why not sort them first:
    self.methods.sort.collect { ... }

-Rob

Rob Biedenharn		http://agileconsultingllc.com
Rob / AgileConsultingLLC.com