# Monkey Patching, passing in extra data, FXRuby bug

**URL:** <https://www.ruby-forum.com/t/monkey-patching-passing-in-extra-data-fxruby-bug/192694>\
**Category:** Ruby\
**Created:** [August 4, 2010, 7:17am UTC](https://www.ruby-forum.com/t/monkey-patching-passing-in-extra-data-fxruby-bug/192694 "2010-08-04T07:17:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ralphshnelvar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Post date:** [August 4, 2010, 7:17am UTC](https://www.ruby-forum.com/t/monkey-patching-passing-in-extra-data-fxruby-bug/192694/1 "2010-08-04T07:17:40Z")

</div>

Because of an apparent bug in FXRuby/Fox/Something that causes a  
segmentation fault …

I am looking for a workaround to a problem.

FXRuby defines a class FXTreeItem.

That class has an instance method for the spaceship operator … \<=\>

And the spaceship operator is called by FXTreeList to sort the child  
node of the Tree for display.

What I want to do is monkey patch the spaceship operator with my own  
spaceship operator … but I need to pass in extra information so that I  
can force the proper sorting order. I don’t control how FXTreeList  
calls the the spaceship operator.

I would be grateful for suggestions on how to do this the Ruby way.
