implementing __getmethod