Class: Object

Inherits:
BasicObject
Defined in:
lib/object/send.rb

Instance Method Summary collapse

Instance Method Details

#send?(method, *args, &block) ⇒ Boolean

Returns the result of method, or nil if method is not a public method.

Parameters:

  • Symbol

    method Method name

  • *args (anyargs, )

    Any number of arguments

  • &block

    block Optional block

Returns:

  • (Boolean)

    Whatever method returns, or nil



8
9
10
# File 'lib/object/send.rb', line 8

def send?(method, *args, &block)
  send(method, *args, &block) if respond_to? method
end