Method: Object#public_send
- Defined in:
- vm_eval.c
#public_send(symbol[, args...]) ⇒ Object #public_send(string[, args...]) ⇒ Object
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
1327 1328 1329 1330 1331 |
# File 'vm_eval.c', line 1327
static VALUE
rb_f_public_send(int argc, VALUE *argv, VALUE recv)
{
return send_internal_kw(argc, argv, recv, CALL_PUBLIC);
}
|