Monday, 3 September 2012

Metaprogramming in ruby

Hi, 



creating code at runtime that defines new methods. In fact, in a sense all Ruby programming is metaprogramming, since even a class definition is not a declaration as it is in Java but actually code that is executed at runtime. Given that this is true, you might wonder whether you can modify a class at runtime. In fact you can, by adding or changing instance methods or class methods, even for Ruby’s built-in classes.


It is a basic feature of Ruby that you can re-open a class definition 
and add or redefine methods.


Thank You,
Uma Mahesh 

No comments:

Post a Comment