hacks/safe_send |
Public Methods |
Object#send is broken, in that it allows private methods to be called, even though they are private. This method will check for calls to protected and private methods to make sure that they are not made; a NameError be thrown if they are.
object | the object to send the message to. |
---|---|
method | the method to call on the object. |
args | the arguments to the method. |
block | an optional code block to send. |
Returns: the return value from the method call.
Always send a message to an object, even if the requested method is private or protected. Does not work for secret methods, since they do access checking on themselves.
object | the object to send the message to. |
---|---|
method | the method to call on the object. |
args | the arguments to the method. |
an | optional code block to send. |
Returns: block the return value from the method call.