Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/core_ext/object.rb
Overview
Provides several backports of Ruby 1.9 features for Ruby implementations not supporting them
Instance Method Summary (collapse)
-
- (Boolean) respond_to?(name, include_private = false)
Returns whether this object responds to the given method.
-
- (Boolean) respond_to_missing?(name, include_private = false)
Returns whether the object can respond to a method.
-
- (Class) singleton_class
Returns the singleton class (also known as eigenclass) of this object.
Instance Method Details
- (Boolean) respond_to?(name, include_private = false)
Returns whether this object responds to the given method
35 36 37 |
# File 'lib/core_ext/object.rb', line 35 def respond_to?(name, include_private = false) super || respond_to_missing?(name, include_private) end |
- (Boolean) respond_to_missing?(name, include_private = false)
Returns whether the object can respond to a method
48 49 50 |
# File 'lib/core_ext/object.rb', line 48 def respond_to_missing?(name, include_private = false) false end |
- (Class) singleton_class
Returns the singleton class (also known as eigenclass) of this object
17 18 19 20 21 |
# File 'lib/core_ext/object.rb', line 17 def singleton_class class << self self end end |