Hi, I'm relatively new to Ruby and this forum (so please forgive me if I make any gaffs) and have run into a problem (or two, or three...). I think it may be an issue with scope for class method names, but I'm really not sure what the issue is. Ruby tells me "no such method when I try to call it. If this is the right place to do it and it's appropriate, I'll post my source code. Just let me know I'm in the right place please. . .
on 2017-01-04 00:11
on 2017-01-04 08:37
Post your code, but make the code as small (compact) as possible, i.e. try to find a short example, which exhibits the behaviour.
on 2017-01-04 17:27
Ronald, Thanks for your reply and suggestion. I had planned to do that. I didn't want to post a lot of my unpretty Ruby code here unless absolutely necessary. However I didn't trust myself to absract the problem properly. If I had identified the problem to that degree I probably wouldn't have needed help debugging it. In any case I took another path. I refactored the code and moved the code in question out of the Class it was in. (I couldn't really justify having it in a class, anyway). It works now, but I still don't know where my problem was. If anyone can point me to a good description/discussion of class method scoping issues and declarations that might still be useful... Thanks again, Chuck
on 2017-01-05 08:42
Charles Brotman wrote in post #1185430: > If anyone can point me to a good description/discussion of class method > scoping issues and declarations that might still be useful... You could read this: https://www.sitepoint.com/understanding-scope-in-ruby/ Aside, I recommend buying "Programming Ruby" by Dave Thomas. It is available as PDF at a fair price by "Pragmatic Programmers". Note that while this book can also be found for free on some E-Book-Sites, theses are actually illegal copies. Ronald