Private method called ?
Published almost 6 years ago
Today is one of the times I hate the way ruby implements it’s own Object oriented concepts – No flames invited. I love ruby. But this is just one of “those” moments..
class Person private def method_missing(method_id, *args) puts "#{method_id} called with #{args.inspect}" true end end class Indian < Person private def secret puts "We are nuts" end end i = Indian.new puts i.secret("Fuck") # $ ruby crap.rb # secret called with ["Fuck"] # true
Here, I’d expect ruby to throw up with “private method `secret’ called for #