Should standard module's flagship methods be stubbed out?

I have a class called Address in address.rb. I want the module Comparable to mix in with my class. I do:

class Address
   include Comparable

..

at this point, I expect the IDE to ask me whether I should add the "<=>" method to this class because that is the reason I used this module.

What's more, when I do Ctrl+O to override method "<=>" from Comparable mixin, I don't get it listed in the popup.

Am I missing something?

-Kedar

3 comments
Comment actions Permalink

Hello Kedar,

Please perform go to declaration on Comparable and tell what are the available options.

Regards,
Oleg

0
Comment actions Permalink

Hi Oleg,

It goes to comparable.rb:

=begin
This is a machine generated stub using stdlib-doc for <b>module Comparable</b>
Ruby sources used:  Ruby-1.9.1 p0
Created on Wed Jun 17 12:55:25 +0400 2009 by IntelliJ Ruby Stubs Generator.
=end
...




-Kedar
0
Comment actions Permalink

Hello Kedar,

Indeed our machine generated stub lacks method <=> for Comparable.
Could you please submit an issue to http://youtrack.jetbrains.net/issues/RUBY
In this case you'll get notified once it is fixed. As a workaround you can hack comparable.rb stub in RubyMine installation.

Regards,
Oleg

0

Please sign in to leave a comment.