ruby - Adding a new method to the Array class -


i have new requirement on array object. need add own method built-in array class.

how add new method whatever array object create, have instance method?

use ruby open classes:

class array   def mymethod     #implementation   end end 

Comments

Popular posts from this blog

How to logout from a login page in asp.net -

Stack level too deep error after upgrade to rails 3.2 and ruby 1.9.3 -