Mega Code Archive
Search
.Net
ASP .Net
ASP .Net Tutorial
C#
C# Book
C# by API
C# Tutorial
VB.Net
VB.Net by API
VB.Net Tutorial
Visual C++ .Net
VisualBasic Script
Java
Java
Java Book
Java by API
Java Tutorial
Script
Flash ActionScript
Flex
JavaScript DHTML
JavaScript Reference
JavaScript Tutorial
Database
MSSQL
MSSQL Tutorial
MySQL
MySQL Tutorial
Oracle PLSQL
Oracle PLSQL Tutorial
PostgreSQL
Languages
Android
C
C Tutorial
C++
C++ Tutorial
Delphi
Perl
PHP
Python
Python Tutorial
Ruby
Silverlight
Office
MSOfficeExcel 2007 Tutorial
MSOfficePowerPoint 2007 Tutorial
MSOfficeWord 2007 Tutorial
Data
XML
XML Tutorial
Ruby
Reflection 86 codes
Home
Ruby
Reflection
1 Add a new method with module_eval
2 Add method to an instance
3 Binding creates a new Method object
4 Bindings
5 Call ancestors on a class name to see its inheritance hierarchy, like this
6 Call remove_const to remove a class definition
7 Check respond_to for new added instance method
8 Check respond_to for new added singleton method
9 Check the object_id before and after replace
10 Check the object_id before and after the assignment
11 Class attribute of string instance
12 Class obj says build me a new class just for object obj
13 Class_eval is ideal for adding methods to a class dynamically
14 Convert all system command to all class method
15 Create a new class and override the method_missing method
16 Create new method dynamically
17 Creating Your Own Version of attr_accessor
18 Determine our objects class and its unique objectID and test its relationship to other classes
19 Discover the names of any of the included modules of an instance or its class using the included_modules method from Module
20 Dynamic Code Execution
21 Each object has its own numeric object ID
22 Find all instance methods of Fixnum that take 2 arguments
23 Find out the singleton_methods
24 Generating and Understanding Tracebacks
25 Get ancestors
26 Get caller line number
27 Get class and superclass
28 Get superclass
29 Get the size of public methods
30 Getting a Reference to a Method
31 If an object is an instance of a given class with the instance_of method from Object
32 If method does not exist, call the default one
33 Inquire after instance methods with a method from Module
34 Instance_variable_set and get
35 Is instance method defined
36 Is it a number
37 Is it a string class instance
38 Kernels method global_variables returns all the global variables, including $ship
39 Listen to extension action
40 Listen to inheritance action
41 Listening for Changes to a Class
42 Listing Methods Unique to an Object
43 Look at an objects ancestors with Modules ancestors method, which returns a list of both classes and modules
44 Look at the objects constants,local, and instance variables
45 Make new private
46 Method instance_variables returns the names of any instance variables associated with an instance (as opposed to class variable
47 Method pointer
48 Object class_variable_set and get
49 Object has a super class in Ruby 1 9
50 Object_id is not changing
51 ObjectSpace each_object
52 Override method_missing method to provide meaningful error message
53 Print out all exceptions
54 Print out only errors
55 Protected_methods
56 Public_methods
57 Query about methods with the Object methods private_methods
58 Query almost any object within Ruby for the methods that are defined within it
59 Reflection and Metaprogramming Introduction
60 Reflection on Methods
61 Responding to Calls to Undefined Methods
62 Return the instance variables with Objects instance_variables
63 Return value based on parameter type
64 Singleton_methods
65 Sort all method from Object
66 String private_instance_methods sort
67 Testing Whether an Object Is String-like
68 The class method supercedes Objects deprecated method type, or gets the name of the class as a string with the name method
69 The keyword __FILE__ stands for the name of the file containing the code
70 The method respond_to tests to see whether an instance of Address has access to
71 The Object class has a class method that returns the name of an instances class
72 The respond_to method from Object checks to see if a given object responds to a given method
73 To determine the name of the superclass
74 Trace function
75 Unlike instance_of, is_of or kind_of also work if the argument is a superclass or module
76 Use === to check the class type
77 Use instance_eval to execute code within the scope of an object
78 Use instance_of for robustness
79 Use is_a to check the class type
80 Use Kernels local_variables method
81 Use module_eval to create dynamic method
82 Use Objects is_a or kind_of methods (they are synonyms)
83 Use singleton_method_added to call a singleton method
84 Use the included_modules method to discover what modules a class uses
85 Uses strings and interpolation with Dynamic Code Execution
86 Want to know what constants the Object class (or some other class) has Use the constants method from Module (output is truncate