You can use partial class definitions to add features to Ruby's standard classes such as Array:
class Array def myMethod # ww w .j av a 2 s . c om puts( "myMethod" ) end end [1,2,3].myMethod
This adds the myMethod method to the Array class so that the code above can now be executed