Adds method property to class definition