I know this is changing gears a little here, but the previous post
reminded me of this.

Say I want to extend the built in Array class with some useless function
called crazy()

class Array
  def crazy
    ...do something...
  end
end


Correct me if I'm wrong, but I now have a class method for Array.  I
call Array.methods just to make sure that it is there, yet it doesn't
show up, however if I do this:

a = []

and then call a.methods, I can see the crazy() method that we wrote
available.  It looks to me as if I am creating an instance method, but I
would think I would do that like this:

def a.crazy
  ...do something...
end


Does this issue have anything to do with the face that the Array class
is immutable?

I'm a bit confused, any help.  Thanks.

-- 
Posted via http://www.ruby-forum.com/.