%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/cpanel/ea-ruby24/root/usr/share/ri/system/Class/
Upload File :
Create Path :
Current File : //opt/cpanel/ea-ruby24/root/usr/share/ri/system/Class/cdesc-Class.ri

U:RDoc::NormalClass[iI"
Class:ET@I"Module;To:RDoc::Markup::Document:@parts[o;;[:
@fileI"class.c;T:0@omit_headings_from_table_of_contents_below0o;;[o:RDoc::Markup::Paragraph;[I";Extends any Class to include _json_creatable?_ method.;T;	I" ext/json/lib/json/common.rb;T;
0o;;[o;;[I"FClasses in Ruby are first-class objects---each is an instance of ;TI"class <code>Class</code>.;To:RDoc::Markup::BlankLineo;;[I"0Typically, you create a new class by using:;T@o:RDoc::Markup::Verbatim;[I"class Name
;TI"0 # some code describing the class behavior
;TI"	end
;T:@format0o;;[I"MWhen a new class is created, an object of type Class is initialized and ;TI"Dassigned to a global constant (<code>Name</code> in this case).;T@o;;[	I"FWhen <code>Name.new</code> is called to create a new object, the ;TI"F<code>new</code> method in <code>Class</code> is run by default. ;TI"@This can be demonstrated by overriding <code>new</code> in ;TI"<code>Class</code>:;T@o;
;[I"class Class
;TI"  alias old_new new
;TI"  def new(*args)
;TI"2    print "Creating a new ", self.name, "\n"
;TI"    old_new(*args)
;TI"  end
;TI"	end
;TI"
;TI"class Name
;TI"	end
;TI"
;TI"n = Name.new
;T;0o;;[I"<em>produces:</em>;T@o;
;[I"Creating a new Name
;T;0o;;[	I"DClasses, modules, and objects are interrelated. In the diagram ;TI"Fthat follows, the vertical arrows represent inheritance, and the ;TI"<parentheses metaclasses. All metaclasses are instances ;TI"of the class `Class'.;To;
;[I"<                         +---------+             +-...
;TI"8                         |         |             |
;TI"<         BasicObject-----|-->(BasicObject)-------|-...
;TI"8             ^           |         ^             |
;TI"8             |           |         |             |
;TI"<          Object---------|----->(Object)---------|-...
;TI"8             ^           |         ^             |
;TI"8             |           |         |             |
;TI"8             +-------+   |         +--------+    |
;TI"8             |       |   |         |        |    |
;TI"<             |    Module-|---------|--->(Module)-|-...
;TI"8             |       ^   |         |        ^    |
;TI"8             |       |   |         |        |    |
;TI"<             |     Class-|---------|---->(Class)-|-...
;TI"8             |       ^   |         |        ^    |
;TI"8             |       +---+         |        +----+
;TI"*             |                     |
;TI";obj--->OtherClass---------->(OtherClass)-----------...;T;0;	I"
object.c;T;
0;	0;
0[[[[[I"
class;T[[:public[[I"new;TI"
object.c;T[:protected[[:private[[I"
instance;T[[;[	[I"
allocate;T@g[I"json_creatable?;FI" ext/json/lib/json/common.rb;T[I"new;T@g[I"superclass;T@g[;[[;[[I"inherited;T@g[[U:RDoc::Context::Section[i0o;;[;	0;
0[@
@@[@[cRDoc::TopLevel

Zerion Mini Shell 1.0