Incorrect 'Incorrect call argument count'?
Hi
I'm relatively new to Ruby and have been trialing Rubymine 6.0.1. I think it's an excellent tool; but I have 1 issue. I cretaed a couple of classes whose initializer takes 2 arguments. But when I instantiate the object I the inspector thinks I've provided two many arguments to the call to new(). Here's an example:
class MyLogFile
def initialize(log_file_root, verbosity)
puts log_file_root
puts verbosity
end
end
logfile = MyLogFile.new('filename.log', true)
logfile2 = MyLogFile.new('filename.log', 'verbose')
Both the creation of "logfile" and "logfile2" give this inspection error. Other similar object initialization for other classes also produces this error.
Have I done something wrong? This is such a basic inpsection I'm surprised it's giving incorrect results.
I'm using RubyMine 6.0.1 on Linux Mint 15 64 bit (running in virtualbox). Java version:
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
Regards
David
Attachment(s):
15-12-2013 17-16-18.jpg
Please sign in to leave a comment.
Sounds like you might have another MyLogFile class defined somewhere in your project. If you right click on of the 'new' method calls and select Go to > Declaration, is it a different method than you expect?
Hi
That was it exactly. When I clicked on Got To -> Declaration it took me to a test file that was residing in the project root folder that just happend to contain early declarations for the classes. I had thought that RubyMine would only search files that were required, included or loaded, or at least take those declarations in preference to a file that's not refered to anywhere.
Anyway, that's it fixed. Many thanks for your assistance.
Regards
David