I am very curious to know what is the difference between send and public_send . For instance:.
class Klass def hello(*args) "Hello " + args.join(' ') end end k = Klass.new k.send :hello, "gentle", "readers" #=> "Hello gentle readers" k.public_send :hello, "gentle", "readers" #=> "Hello gentle readers"
Can someone explain the difference?
source share