Overriding a method of a class

Elgg 2.3.14

In my_plugin I need to override one method in a class of another_plugin.

I tried to use elgg_register_class() but it did not work. Maybe I made some mistake.

The class reside in:

another_plugin/classes/some_folder/class_name.php

Thank you for your guidance.