reverted back our changes and added in the new define_method
Merge pull request #9206 from ranjaykrishna/use_define_method

Use define method instead of class_eval