Convert define_example_method to use define_method