method
public_send
v2_2_9 -
Show latest stable
- Class:
Object
public_send(*args)public
Invokes the method identified by symbol, passing it any arguments specified. Unlike send, public_send calls public methods only. When the method is identified by a string, the string is converted to a symbol.
1.public_send(:puts, "hello") # causes NoMethodError