Last Updated: February 25, 2016
·
644
· raysrashmi

Power of Object#send()

class Foo private def fooprivate puts "Test Private" end end </pre> </code> So now if do object = Foo.new object.fooprivate </code> We all know it will throw error private method `foo_private' called for #Foo:0x007ff562084b48 (NoMethodError) </pre></code>

Now call it in send
object.send(:foo_private) => # "Test Private"