class Object
Extends Ruby’s own Object
class with method respond_to_missing?
for Ruby < 1.9.2
@author Sebastian Staudt @since 0.4.0
Public Instance Methods
respond_to?(symbol, include_private = false)
click to toggle source
Returns true
if obj responds to the given method. Private methods are included in the search only if the optional second parameter evaluates to true
.
If the method is not implemented, as Process.fork on Windows, File.lchmod on GNU/Linux, etc., false
is returned.
If the method is not defined, respond_to_missing? method is called and the result is returned.
@see respond_to_missing?
Calls superclass method
# File lib/core_ext/object.rb, line 26 def respond_to?(symbol, include_private = false) super || respond_to_missing?(symbol, include_private) end
respond_to_missing?(symbol, include_private = false)
click to toggle source
Hook method to return whether the obj can respond to id method or not.
@param [Symbol] symbol The id of the method to check @return [Boolean] true
if this object responds to this method via
via method_missing
@see method_missing @see respond_to?
# File lib/core_ext/object.rb, line 38 def respond_to_missing?(symbol, include_private = false) false end