Home
Ruby
ActiveRecord
Array
CGI
Class
Collections
Database
Date
Design Patterns
Development
File Directory
GUI
Hash
Language Basics
Method
Network
Number
Rails
Range
Reflection
Statement
String
Threads
Time
Tk
Unit Test
Windows Platform
XML
Menu
respond_to « Reflection « Ruby
Ruby
Reflection
respond_to
1.
The respond_to? method from Object checks to see if a given object responds to a given method.
2.
The method respond_to? tests to see whether an instance of Address has access to :given_name, inherited from the Name class.
3.
Testing Whether an Object Is String-like
4.
Check respond_to? for new added instance method
5.
Check respond_to? for new added singleton method