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
class attribute of string instance : Class Reflection « Reflection « Ruby
Ruby
Reflection
Class Reflection
class attribute of string instance
x =
"This is a test"
puts x.class
Related examples in the same category
1.
Call ancestors on a class name to see its inheritance hierarchy, like this:
2.
The Object class has a class method that returns the name of an instance's class
3.
The class method supercedes Object's deprecated method type, or gets the name of the class as a string with the name method
4.
To determine the name of the superclass
5.
Reflection and Metaprogramming Introduction