Hi --
Hi there!
I need to create a method with name, that contains '-' character. Is
it possible, and if the answer is "yes", how can I do it?
The only way I know of is:
irb(main):002:0> class C
irb(main):003:1> define_method("x-y") { puts "Weird method" }
irb(main):004:1> end
At which point, the only way to call it is:
irb(main):005:0> C.new.send("x-y") # Weird method
In other words, it's not worth the trouble and you should find some
other solution.
David
--
Upcoming training by David A. Black/Ruby Power and Light, LLC:
* Advancing With Rails, Edison, NJ, November 6-9
* Advancing With Rails, Berlin, Germany, November 19-22
* Intro to Rails, London, UK, December 3-6 (by Skills Matter)
See
http://www.rubypal.com for details!