method

public_send

Importance_1
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
Show source
Register or log in to add new notes.