Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated docs with SingletonClass name change.

  • Loading branch information...
commit f40d178be548c293efd5d1c24bb9af0d4ad83a2b 1 parent ebebe89
@brixen brixen authored
View
143 web/_site/doc/de/appendix-a-glossary/index.html
@@ -130,41 +130,6 @@
<ul>
<li>
- <p><em>metaclass (Metaklasse)</em></p>
-
- <p>Auch +singleton+ class oder +eigenclass+ genannt. Jedes Objekt in
-Ruby kann eine singleton Klasse haben, wobei diese nur nach Bedarf
-erzeugt werden. Die Metaklasse enthält die Methoden- und
-Konstantentabellen welche jeweils nur zu einer bestimmten
-Objektinstanz gehören.
-Zum Beispiel existiert die unten definierte Methode +hello+ nur in
-der Metaklasse von +obj+.</p>
-
- <pre><code>obj = Object.new
-def obj.hello
- puts 'hi'
-end
-</code></pre>
-
- <p>Da alle Klassen in Ruby ebenfalls Objekte sind, können diese auch
-Metaklassen besitzen. &ldquo;Klassenmethoden&rdquo; sind somit lediglich
-Methoden, die in der Metaklasse einer Klasse definiert (d.h. in der
-Methodentabelle der Metaklasse eingetragen) sind. Die Methode +honk+
-existiert in der Metaklasse der Klasse +Car+.</p>
-
- <pre><code>class Car
- def self.honk
- end
-end
-</code></pre>
-
- <p>In Rubinius sind Metaklassen Instanzen der Klasse +MetaClass+. Die
-Metaklasse eines Objektes kann durch den Aufruf der +metaclass+
-Methode erhalten werden. Insgesamt wird die Anordnung der dabei
-beteiligten Konzepte als &ldquo;Meta-Object Protocol&rdquo; oder +MOP+
-bezeichnet.</p>
- </li>
- <li>
<p><em>method lookup oder method resolution</em></p>
<p>Es ist ganz einfach: Nimm das Objekt im &lsquo;class slot&rsquo; des Objekts
@@ -179,41 +144,41 @@
method_missing. Schlägt die Suche nach method_missing fehl, wirf
einen Fehler (Exception).</p>
- <pre><code> +-------------+
- | nil |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Object |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Module |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Class |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | MetaClass |
- | (Object) |
- +-------------+
- ^
- | superclass
- |
- +-------------+ +-------------+
- | F | -----------------&gt; | MetaClass |
- +-------------+ metaclass | (F) |
- +-------------+
+ <pre><code> +----------------+
+ | nil |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Object |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Module |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Class |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | SingletonClass |
+ | (Object) |
+ +----------------+
+ ^
+ | superclass
+ |
+ +-------------+ +----------------+
+ | F | -----------------&gt; | SingletonClass |
+ +-------------+ singleton class | (F) |
+ +----------------+
class Class
@@ -234,8 +199,8 @@
<p>Finde Methode &lsquo;wanker&rsquo; &ndash; Durchsuche Methodentabellen in:</p>
<ol>
- <li>MetaClass(F)</li>
- <li>MetaClass(Object)</li>
+ <li>SingletonClass(F)</li>
+ <li>SingletonClass(Object)</li>
<li>Class</li>
</ol>
</li>
@@ -298,6 +263,40 @@
der explizite Empfänger.</p>
</li>
<li>
+ <p><em>metaclass (Metaklasse)</em></p>
+
+ <p>Auch +singleton+ class oder +eigenclass+ genannt. Jedes Objekt in
+Ruby kann eine singleton Klasse haben, wobei diese nur nach Bedarf
+erzeugt werden. Die Metaklasse enthält die Methoden- und
+Konstantentabellen welche jeweils nur zu einer bestimmten
+Objektinstanz gehören.
+Zum Beispiel existiert die unten definierte Methode +hello+ nur in
+der Metaklasse von +obj+.</p>
+
+ <pre><code>obj = Object.new
+def obj.hello
+ puts 'hi'
+end
+</code></pre>
+
+ <p>Da alle Klassen in Ruby ebenfalls Objekte sind, können diese auch
+Metaklassen besitzen. &ldquo;Klassenmethoden&rdquo; sind somit lediglich
+Methoden, die in der Metaklasse einer Klasse definiert (d.h. in der
+Methodentabelle der Metaklasse eingetragen) sind. Die Methode +honk+
+existiert in der Metaklasse der Klasse +Car+.</p>
+
+ <pre><code>class Car
+ def self.honk
+ end
+end
+</code></pre>
+
+ <p>In Rubinius sind Metaklassen Instanzen der Klasse +SingletonClass+. Die
+Metaklasse eines Objektes kann durch den Aufruf der +metaclass+ Methode
+erhalten werden. Insgesamt wird die Anordnung der dabei beteiligten Konzepte
+als &ldquo;Meta-Object Protocol&rdquo; oder +MOP+ bezeichnet.</p>
+ </li>
+ <li>
<p><em>superclass (Superklasse)</em></p>
<p>Die Klasse von der eine bestimmte Klasse direkt erbt. Die Object
View
137 web/_site/doc/en/appendix-a-glossary/index.html
@@ -129,83 +129,52 @@
<ul>
<li>
- <p><em>metaclass</em></p>
-
- <p>Also called the +singleton+ class or +eigenclass+. Every object in Ruby can
-have one, although they are only created as necessary. The metaclass holds the
-method and constant tables that belong only to a particular object instance.
-For example, the method +hello+ defined below exists only in the metaclass for
-+obj+.</p>
-
- <pre><code>obj = Object.new
-def obj.hello
- puts 'hi'
-end
-</code></pre>
-
- <p>Since all classes in Ruby are also objects, they can have metaclasses. The
-methods called &ldquo;class methods&rdquo; are just methods in the method_table of the
-class&rsquo;s metaclass. The method +honk+ exists in the metaclass for the class
-+Car+.</p>
-
- <pre><code>class Car
- def self.honk
- end
-end
-</code></pre>
-
- <p>In Rubinius, metaclasses are all instances of the class MetaClass. The
-metaclass for an object can be obtained by calling the +metaclass+ method.
-The overall arrangement of concepts involved here is sometimes referred to
-as the &lsquo;Meta-Object Protocol&rsquo; or +MOP+.</p>
- </li>
- <li>
<p><em>method lookup or method resolution</em></p>
<p>The rule is simple: Take the object located in the class slot of the object
(which is not always the return value of Object#class; if the object has one,
-it&rsquo;ll be the metaclass) and begin searching.</p>
+it&rsquo;ll be the singleton class) and begin searching.</p>
<p>Searching goes up the superclass chain until the superclass is nil.</p>
<p>In which case, redo lookup for method_missing. If we fail to find
method_missing, fail tragically.</p>
- <pre><code> +-------------+
- | nil |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Object |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Module |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Class |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | MetaClass |
- | (Object) |
- +-------------+
- ^
- | superclass
- |
- +-------------+ +-------------+
- | F | -----------------&gt; | MetaClass |
- +-------------+ metaclass | (F) |
- +-------------+
+ <pre><code> +----------------+
+ | nil |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Object |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Module |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Class |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | SingletonClass |
+ | (Object) |
+ +----------------+
+ ^
+ | superclass
+ |
+ +-------------+ +----------------+
+ | F | -----------------&gt; | SingletonClass |
+ +-------------+ singleton class | (F) |
+ +----------------+
class Class
@@ -226,8 +195,8 @@
<p>Resolve method &lsquo;wanker&rsquo; &ndash; search method_tables in:</p>
<ol>
- <li>MetaClass(F)</li>
- <li>MetaClass(Object)</li>
+ <li>SingletonClass(F)</li>
+ <li>SingletonClass(Object)</li>
<li>Class</li>
</ol>
</li>
@@ -286,6 +255,36 @@
receiver.</p>
</li>
<li>
+ <p><em>singleton class</em></p>
+
+ <p>Every object in Ruby can have one, although they are only created as
+necessary. The singleton class holds the method and constant tables that
+belong only to a particular object instance. For example, the method
++hello+ defined below exists only in the singleton class for +obj+.</p>
+
+ <pre><code>obj = Object.new
+def obj.hello
+ puts 'hi'
+end
+</code></pre>
+
+ <p>Since all classes in Ruby are also objects, they can have singleton classes.
+The methods called &ldquo;class methods&rdquo; are just methods in the method_table of
+the class&rsquo;s singleton class. The method +honk+ exists in the singleton class
+for the class +Car+.</p>
+
+ <pre><code>class Car
+ def self.honk
+ end
+end
+</code></pre>
+
+ <p>In Rubinius, singleton classes are all instances of the class
+SingletonClass. The singleton class for an object can be obtained by calling
+the +singleton_class+ method. The overall arrangement of concepts involved
+here is sometimes referred to as the &lsquo;Meta-Object Protocol&rsquo; or +MOP+.</p>
+ </li>
+ <li>
<p><em>superclass</em></p>
<p>The class that a particular class immediately inherits from. The class Object
View
138 web/_site/doc/es/appendix-a-glossary/index.html
@@ -119,39 +119,8 @@
<ul>
<li>
- <p><em>metaclass (metaclase)</em></p>
-
- <p>También llamada la clase +singleton+ o +eigenclass+. Cualquier objeto en Ruby
-puede tener una aunque solamente son creadas cuando es necesario. La metaclase
-tiene las tablas de métodos y constantes que preñen a una instancia (objeto)
-en particular. Por ejemplo, el método +hello+ definido a continuación existe
-solamente en la metaclase de +obj+.</p>
-
- <pre><code>obj = Object.new
-def obj.hello
- puts 'hi'
-end
-</code></pre>
-
- <p>Ya que las clases en Ruby también son objetos, estas pueden tener metaclases.
-Los métodos de clase (<em>class methods</em>) son simplemente métodos en la tabla
-de métodos de la metaclase de la clase. El método +honk+ existe en la
-metaclase de la clase +Car+.</p>
-
- <pre><code>class Car
- def self.honk
- end
-end
-</code></pre>
-
- <p>Todas las metaclases en Rubinius son instancias de la clase MetaClass. La
-metaclase para un objeto puede ser obtenida llamando al método +metaclass+.
-Los conceptos mencionados aquí se conocen como el &lsquo;Meta-Object Protocol&rsquo;
-o +MOP+.</p>
- </li>
- <li>
<p><em>method lookup or method resolution (búsqueda de métodos o resolución
-de métodos</em></p>
+de métodos)</em></p>
<p>La regla para la resolución de métodos es sencilla: Se toma el objeto
que se encuentra en la posición <em>class</em> del objeto (que no siempre es
@@ -163,41 +132,41 @@
<p>Si superclass es nil se vuelve a comenzar la búsqueda tratando de hallar
method_missing. Si no se encuentra method_missing se genera un error.</p>
- <pre><code> +-------------+
- | nil |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Object |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Module |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Class |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | MetaClass |
- | (Object) |
- +-------------+
- ^
- | superclass
- |
- +-------------+ +-------------+
- | F | -----------------&gt; | MetaClass |
- +-------------+ metaclass | (F) |
- +-------------+
+ <pre><code> +----------------+
+ | nil |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Object |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Module |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Class |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | SingletonClass |
+ | (Object) |
+ +----------------+
+ ^
+ | superclass
+ |
+ +-------------+ +----------------+
+ | F | -----------------&gt; | SingletonClass |
+ +-------------+ singleton class | (F) |
+ +----------------+
class Class
@@ -219,8 +188,8 @@
method_tables de:</p>
<ol>
- <li>MetaClass(F)</li>
- <li>MetaClass(Object)</li>
+ <li>SingletonClass(F)</li>
+ <li>SingletonClass(Object)</li>
<li>Class</li>
</ol>
</li>
@@ -280,6 +249,37 @@
el receptor explícito.</p>
</li>
<li>
+ <p><em>singleton class (metaclase)</em></p>
+
+ <p>Cualquier objeto en Ruby puede tener una aunque solamente son creadas cuando
+es necesario. La singleton clase tiene las tablas de métodos y constantes
+que preñen a una instancia (objeto) en particular. Por ejemplo, el método
++hello+ definido a continuación existe solamente en la singleton clase de
++obj+.</p>
+
+ <pre><code>obj = Object.new
+def obj.hello
+ puts 'hi'
+end
+</code></pre>
+
+ <p>Ya que las clases en Ruby también son objetos, estas pueden tener singleton
+clases. Los métodos de clase (<em>class methods</em>) son simplemente métodos en
+la tabla de métodos de la singleton clase de la clase. El método +honk+
+existe en la singleton clase de la clase +Car+.</p>
+
+ <pre><code>class Car
+ def self.honk
+ end
+end
+</code></pre>
+
+ <p>Todas las singleton clases en Rubinius son instancias de la clase
+SingletonClass. La singleton clase para un objeto puede ser obtenida
+llamando al método +singleton_class+. Los conceptos mencionados aquí se
+conocen como el &lsquo;Meta-Object Protocol&rsquo; o +MOP+.</p>
+ </li>
+ <li>
<p><em>superclass (superclase)</em></p>
<p>La clase de la cual una clase en particular hereda. La clase Object es la
View
137 web/_site/doc/ja/appendix-a-glossary/index.html
@@ -137,83 +137,52 @@
<ul>
<li>
- <p><em>metaclass</em></p>
-
- <p>Also called the +singleton+ class or +eigenclass+. Every object in Ruby can
-have one, although they are only created as necessary. The metaclass holds the
-method and constant tables that belong only to a particular object instance.
-For example, the method +hello+ defined below exists only in the metaclass for
-+obj+.</p>
-
- <pre><code>obj = Object.new
-def obj.hello
- puts 'hi'
-end
-</code></pre>
-
- <p>Since all classes in Ruby are also objects, they can have metaclasses. The
-methods called &ldquo;class methods&rdquo; are just methods in the method_table of the
-class&rsquo;s metaclass. The method +honk+ exists in the metaclass for the class
-+Car+.</p>
-
- <pre><code>class Car
- def self.honk
- end
-end
-</code></pre>
-
- <p>In Rubinius, metaclasses are all instances of the class MetaClass. The
-metaclass for an object can be obtained by calling the +metaclass+ method.
-The overall arrangement of concepts involved here is sometimes referred to
-as the &lsquo;Meta-Object Protocol&rsquo; or +MOP+.</p>
- </li>
- <li>
<p><em>method lookup or method resolution</em></p>
<p>The rule is simple: Take the object located in the class slot of the object
(which is not always the return value of Object#class; if the object has one,
-it&rsquo;ll be the metaclass) and begin searching.</p>
+it&rsquo;ll be the singleton class) and begin searching.</p>
<p>Searching goes up the superclass chain until the superclass is nil.</p>
<p>In which case, redo lookup for method_missing. If we fail to find
method_missing, fail tragically.</p>
- <pre><code> +-------------+
- | nil |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Object |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Module |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Class |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | MetaClass |
- | (Object) |
- +-------------+
- ^
- | superclass
- |
- +-------------+ +-------------+
- | F | -----------------&gt; | MetaClass |
- +-------------+ metaclass | (F) |
- +-------------+
+ <pre><code> +----------------+
+ | nil |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Object |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Module |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Class |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | SingletonClass |
+ | (Object) |
+ +----------------+
+ ^
+ | superclass
+ |
+ +-------------+ +----------------+
+ | F | -----------------&gt; | SingletonClass |
+ +-------------+ singleton class | (F) |
+ +----------------+
class Class
@@ -234,8 +203,8 @@
<p>Resolve method &lsquo;wanker&rsquo; &ndash; search method_tables in:</p>
<ol>
- <li>MetaClass(F)</li>
- <li>MetaClass(Object)</li>
+ <li>SingletonClass(F)</li>
+ <li>SingletonClass(Object)</li>
<li>Class</li>
</ol>
</li>
@@ -294,6 +263,36 @@
receiver.</p>
</li>
<li>
+ <p><em>singleton class</em></p>
+
+ <p>Every object in Ruby can have one, although they are only created as
+necessary. The singleton class holds the method and constant tables that
+belong only to a particular object instance. For example, the method
++hello+ defined below exists only in the singleton class for +obj+.</p>
+
+ <pre><code>obj = Object.new
+def obj.hello
+ puts 'hi'
+end
+</code></pre>
+
+ <p>Since all classes in Ruby are also objects, they can have singleton classes.
+The methods called &ldquo;class methods&rdquo; are just methods in the method_table of
+the class&rsquo;s singleton class. The method +honk+ exists in the singleton class
+for the class +Car+.</p>
+
+ <pre><code>class Car
+ def self.honk
+ end
+end
+</code></pre>
+
+ <p>In Rubinius, singleton classes are all instances of the class
+SingletonClass. The singleton class for an object can be obtained by calling
+the +singleton_class+ method. The overall arrangement of concepts involved
+here is sometimes referred to as the &lsquo;Meta-Object Protocol&rsquo; or +MOP+.</p>
+ </li>
+ <li>
<p><em>superclass</em></p>
<p>The class that a particular class immediately inherits from. The class Object
View
137 web/_site/doc/pl/appendix-a-glossary/index.html
@@ -129,83 +129,52 @@
<ul>
<li>
- <p><em>metaclass</em></p>
-
- <p>Also called the +singleton+ class or +eigenclass+. Every object in Ruby can
-have one, although they are only created as necessary. The metaclass holds the
-method and constant tables that belong only to a particular object instance.
-For example, the method +hello+ defined below exists only in the metaclass for
-+obj+.</p>
-
- <pre><code>obj = Object.new
-def obj.hello
- puts 'hi'
-end
-</code></pre>
-
- <p>Since all classes in Ruby are also objects, they can have metaclasses. The
-methods called &ldquo;class methods&rdquo; are just methods in the method_table of the
-class&rsquo;s metaclass. The method +honk+ exists in the metaclass for the class
-+Car+.</p>
-
- <pre><code>class Car
- def self.honk
- end
-end
-</code></pre>
-
- <p>In Rubinius, metaclasses are all instances of the class MetaClass. The
-metaclass for an object can be obtained by calling the +metaclass+ method.
-The overall arrangement of concepts involved here is sometimes referred to
-as the &lsquo;Meta-Object Protocol&rsquo; or +MOP+.</p>
- </li>
- <li>
<p><em>method lookup or method resolution</em></p>
<p>The rule is simple: Take the object located in the class slot of the object
(which is not always the return value of Object#class; if the object has one,
-it&rsquo;ll be the metaclass) and begin searching.</p>
+it&rsquo;ll be the singleton class) and begin searching.</p>
<p>Searching goes up the superclass chain until the superclass is nil.</p>
<p>In which case, redo lookup for method_missing. If we fail to find
method_missing, fail tragically.</p>
- <pre><code> +-------------+
- | nil |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Object |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Module |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Class |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | MetaClass |
- | (Object) |
- +-------------+
- ^
- | superclass
- |
- +-------------+ +-------------+
- | F | -----------------&gt; | MetaClass |
- +-------------+ metaclass | (F) |
- +-------------+
+ <pre><code> +----------------+
+ | nil |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Object |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Module |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Class |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | SingletonClass |
+ | (Object) |
+ +----------------+
+ ^
+ | superclass
+ |
+ +-------------+ +----------------+
+ | F | -----------------&gt; | SingletonClass |
+ +-------------+ singleton class | (F) |
+ +----------------+
class Class
@@ -226,8 +195,8 @@
<p>Resolve method &lsquo;wanker&rsquo; &ndash; search method_tables in:</p>
<ol>
- <li>MetaClass(F)</li>
- <li>MetaClass(Object)</li>
+ <li>SingletonClass(F)</li>
+ <li>SingletonClass(Object)</li>
<li>Class</li>
</ol>
</li>
@@ -286,6 +255,36 @@
receiver.</p>
</li>
<li>
+ <p><em>singleton class</em></p>
+
+ <p>Every object in Ruby can have one, although they are only created as
+necessary. The singleton class holds the method and constant tables that
+belong only to a particular object instance. For example, the method
++hello+ defined below exists only in the singleton class for +obj+.</p>
+
+ <pre><code>obj = Object.new
+def obj.hello
+ puts 'hi'
+end
+</code></pre>
+
+ <p>Since all classes in Ruby are also objects, they can have singleton classes.
+The methods called &ldquo;class methods&rdquo; are just methods in the method_table of
+the class&rsquo;s singleton class. The method +honk+ exists in the singleton class
+for the class +Car+.</p>
+
+ <pre><code>class Car
+ def self.honk
+ end
+end
+</code></pre>
+
+ <p>In Rubinius, singleton classes are all instances of the class
+SingletonClass. The singleton class for an object can be obtained by calling
+the +singleton_class+ method. The overall arrangement of concepts involved
+here is sometimes referred to as the &lsquo;Meta-Object Protocol&rsquo; or +MOP+.</p>
+ </li>
+ <li>
<p><em>superclass</em></p>
<p>The class that a particular class immediately inherits from. The class Object
View
70 web/_site/doc/ru/appendix-a-glossary/index.html
@@ -172,41 +172,41 @@
<p>В этом случае повторяется поиск для метода method_missing. Если и этот
метод не будет найден &ndash; трагедия.</p>
- <pre><code> +-------------+
- | nil |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Object |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Module |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Class |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | MetaClass |
- | (Object) |
- +-------------+
- ^
- | superclass
- |
- +-------------+ +-------------+
- | F | -----------------&gt; | MetaClass |
- +-------------+ metaclass | (F) |
- +-------------+
+ <pre><code> +----------------+
+ | nil |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Object |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Module |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Class |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | SingletonClass |
+ | (Object) |
+ +----------------+
+ ^
+ | superclass
+ |
+ +-------------+ +----------------+
+ | F | -----------------&gt; | SingletonClass |
+ +-------------+ singleton class | (F) |
+ +----------------+
class Class
View
139 web/doc/de/appendix-a-glossary.markdown
@@ -16,39 +16,6 @@ Programmer's Guide" 2. oder 3. Auflage von Thomas et al [The Pragmatic Programme
2005-2008]
-* _metaclass (Metaklasse)_
-
- Auch +singleton+ class oder +eigenclass+ genannt. Jedes Objekt in
- Ruby kann eine singleton Klasse haben, wobei diese nur nach Bedarf
- erzeugt werden. Die Metaklasse enthält die Methoden- und
- Konstantentabellen welche jeweils nur zu einer bestimmten
- Objektinstanz gehören.
- Zum Beispiel existiert die unten definierte Methode +hello+ nur in
- der Metaklasse von +obj+.
-
- obj = Object.new
- def obj.hello
- puts 'hi'
- end
-
- Da alle Klassen in Ruby ebenfalls Objekte sind, können diese auch
- Metaklassen besitzen. "Klassenmethoden" sind somit lediglich
- Methoden, die in der Metaklasse einer Klasse definiert (d.h. in der
- Methodentabelle der Metaklasse eingetragen) sind. Die Methode +honk+
- existiert in der Metaklasse der Klasse +Car+.
-
- class Car
- def self.honk
- end
- end
-
- In Rubinius sind Metaklassen Instanzen der Klasse +MetaClass+. Die
- Metaklasse eines Objektes kann durch den Aufruf der +metaclass+
- Methode erhalten werden. Insgesamt wird die Anordnung der dabei
- beteiligten Konzepte als "Meta-Object Protocol" oder +MOP+
- bezeichnet.
-
-
* _method lookup oder method resolution_
Es ist ganz einfach: Nimm das Objekt im 'class slot' des Objekts
@@ -63,41 +30,41 @@ Programmer's Guide" 2. oder 3. Auflage von Thomas et al [The Pragmatic Programme
method_missing. Schlägt die Suche nach method_missing fehl, wirf
einen Fehler (Exception).
- +-------------+
- | nil |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Object |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Module |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Class |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | MetaClass |
- | (Object) |
- +-------------+
- ^
- | superclass
- |
- +-------------+ +-------------+
- | F | -----------------> | MetaClass |
- +-------------+ metaclass | (F) |
- +-------------+
+ +----------------+
+ | nil |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Object |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Module |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Class |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | SingletonClass |
+ | (Object) |
+ +----------------+
+ ^
+ | superclass
+ |
+ +-------------+ +----------------+
+ | F | -----------------> | SingletonClass |
+ +-------------+ singleton class | (F) |
+ +----------------+
class Class
@@ -114,8 +81,8 @@ Programmer's Guide" 2. oder 3. Auflage von Thomas et al [The Pragmatic Programme
1. Finde Methode 'wanker' -- Durchsuche Methodentabellen in:
- 1. MetaClass(F)
- 1. MetaClass(Object)
+ 1. SingletonClass(F)
+ 1. SingletonClass(Object)
1. Class
Gefunden.
@@ -174,6 +141,38 @@ Programmer's Guide" 2. oder 3. Auflage von Thomas et al [The Pragmatic Programme
der explizite Empfänger.
+* _metaclass (Metaklasse)_
+
+ Auch +singleton+ class oder +eigenclass+ genannt. Jedes Objekt in
+ Ruby kann eine singleton Klasse haben, wobei diese nur nach Bedarf
+ erzeugt werden. Die Metaklasse enthält die Methoden- und
+ Konstantentabellen welche jeweils nur zu einer bestimmten
+ Objektinstanz gehören.
+ Zum Beispiel existiert die unten definierte Methode +hello+ nur in
+ der Metaklasse von +obj+.
+
+ obj = Object.new
+ def obj.hello
+ puts 'hi'
+ end
+
+ Da alle Klassen in Ruby ebenfalls Objekte sind, können diese auch
+ Metaklassen besitzen. "Klassenmethoden" sind somit lediglich
+ Methoden, die in der Metaklasse einer Klasse definiert (d.h. in der
+ Methodentabelle der Metaklasse eingetragen) sind. Die Methode +honk+
+ existiert in der Metaklasse der Klasse +Car+.
+
+ class Car
+ def self.honk
+ end
+ end
+
+ In Rubinius sind Metaklassen Instanzen der Klasse +SingletonClass+. Die
+ Metaklasse eines Objektes kann durch den Aufruf der +metaclass+ Methode
+ erhalten werden. Insgesamt wird die Anordnung der dabei beteiligten Konzepte
+ als "Meta-Object Protocol" oder +MOP+ bezeichnet.
+
+
* _superclass (Superklasse)_
Die Klasse von der eine bestimmte Klasse direkt erbt. Die Object
View
133 web/doc/en/appendix-a-glossary.markdown
@@ -15,81 +15,52 @@ Guide" 2nd or 3rd Edition by Thomas et al [The Pragmatic Programmers
2005-2008]
-* _metaclass_
-
- Also called the +singleton+ class or +eigenclass+. Every object in Ruby can
- have one, although they are only created as necessary. The metaclass holds the
- method and constant tables that belong only to a particular object instance.
- For example, the method +hello+ defined below exists only in the metaclass for
- +obj+.
-
- obj = Object.new
- def obj.hello
- puts 'hi'
- end
-
- Since all classes in Ruby are also objects, they can have metaclasses. The
- methods called "class methods" are just methods in the method_table of the
- class's metaclass. The method +honk+ exists in the metaclass for the class
- +Car+.
-
- class Car
- def self.honk
- end
- end
-
- In Rubinius, metaclasses are all instances of the class MetaClass. The
- metaclass for an object can be obtained by calling the +metaclass+ method.
- The overall arrangement of concepts involved here is sometimes referred to
- as the 'Meta-Object Protocol' or +MOP+.
-
-
* _method lookup or method resolution_
The rule is simple: Take the object located in the class slot of the object
(which is not always the return value of Object#class; if the object has one,
- it'll be the metaclass) and begin searching.
+ it'll be the singleton class) and begin searching.
Searching goes up the superclass chain until the superclass is nil.
In which case, redo lookup for method_missing. If we fail to find
method_missing, fail tragically.
- +-------------+
- | nil |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Object |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Module |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Class |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | MetaClass |
- | (Object) |
- +-------------+
- ^
- | superclass
- |
- +-------------+ +-------------+
- | F | -----------------> | MetaClass |
- +-------------+ metaclass | (F) |
- +-------------+
+ +----------------+
+ | nil |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Object |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Module |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Class |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | SingletonClass |
+ | (Object) |
+ +----------------+
+ ^
+ | superclass
+ |
+ +-------------+ +----------------+
+ | F | -----------------> | SingletonClass |
+ +-------------+ singleton class | (F) |
+ +----------------+
class Class
@@ -106,8 +77,8 @@ Guide" 2nd or 3rd Edition by Thomas et al [The Pragmatic Programmers
1. Resolve method 'wanker' -- search method_tables in:
- 1. MetaClass(F)
- 1. MetaClass(Object)
+ 1. SingletonClass(F)
+ 1. SingletonClass(Object)
1. Class
Found
@@ -162,6 +133,34 @@ Guide" 2nd or 3rd Edition by Thomas et al [The Pragmatic Programmers
receiver.
+* _singleton class_
+
+ Every object in Ruby can have one, although they are only created as
+ necessary. The singleton class holds the method and constant tables that
+ belong only to a particular object instance. For example, the method
+ +hello+ defined below exists only in the singleton class for +obj+.
+
+ obj = Object.new
+ def obj.hello
+ puts 'hi'
+ end
+
+ Since all classes in Ruby are also objects, they can have singleton classes.
+ The methods called "class methods" are just methods in the method_table of
+ the class's singleton class. The method +honk+ exists in the singleton class
+ for the class +Car+.
+
+ class Car
+ def self.honk
+ end
+ end
+
+ In Rubinius, singleton classes are all instances of the class
+ SingletonClass. The singleton class for an object can be obtained by calling
+ the +singleton_class+ method. The overall arrangement of concepts involved
+ here is sometimes referred to as the 'Meta-Object Protocol' or +MOP+.
+
+
* _superclass_
The class that a particular class immediately inherits from. The class Object
View
134 web/doc/es/appendix-a-glossary.markdown
@@ -13,36 +13,8 @@ Matsumoto [O'Reilly 2008] y "Programming Ruby: The Pragmatic Programmer's Guide"
segunda o tercera edición por Thomas et al [The Pragmatic Programmers 2005-2008].
-* _metaclass (metaclase)_
-
- También llamada la clase +singleton+ o +eigenclass+. Cualquier objeto en Ruby
- puede tener una aunque solamente son creadas cuando es necesario. La metaclase
- tiene las tablas de métodos y constantes que preñen a una instancia (objeto)
- en particular. Por ejemplo, el método +hello+ definido a continuación existe
- solamente en la metaclase de +obj+.
-
- obj = Object.new
- def obj.hello
- puts 'hi'
- end
-
- Ya que las clases en Ruby también son objetos, estas pueden tener metaclases.
- Los métodos de clase (*class methods*) son simplemente métodos en la tabla
- de métodos de la metaclase de la clase. El método +honk+ existe en la
- metaclase de la clase +Car+.
-
- class Car
- def self.honk
- end
- end
-
- Todas las metaclases en Rubinius son instancias de la clase MetaClass. La
- metaclase para un objeto puede ser obtenida llamando al método +metaclass+.
- Los conceptos mencionados aquí se conocen como el 'Meta-Object Protocol'
- o +MOP+.
-
* _method lookup or method resolution (búsqueda de métodos o resolución
- de métodos_
+ de métodos)_
La regla para la resolución de métodos es sencilla: Se toma el objeto
que se encuentra en la posición *class* del objeto (que no siempre es
@@ -54,41 +26,41 @@ segunda o tercera edición por Thomas et al [The Pragmatic Programmers 2005-2008
Si superclass es nil se vuelve a comenzar la búsqueda tratando de hallar
method_missing. Si no se encuentra method_missing se genera un error.
- +-------------+
- | nil |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Object |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Module |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Class |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | MetaClass |
- | (Object) |
- +-------------+
- ^
- | superclass
- |
- +-------------+ +-------------+
- | F | -----------------> | MetaClass |
- +-------------+ metaclass | (F) |
- +-------------+
+ +----------------+
+ | nil |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Object |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Module |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Class |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | SingletonClass |
+ | (Object) |
+ +----------------+
+ ^
+ | superclass
+ |
+ +-------------+ +----------------+
+ | F | -----------------> | SingletonClass |
+ +-------------+ singleton class | (F) |
+ +----------------+
class Class
@@ -106,8 +78,8 @@ segunda o tercera edición por Thomas et al [The Pragmatic Programmers 2005-2008
1. Para la resolución del método 'wanker' se hace la búsqueda en las
method_tables de:
- 1. MetaClass(F)
- 1. MetaClass(Object)
+ 1. SingletonClass(F)
+ 1. SingletonClass(Object)
1. Class
Encontrado.
@@ -161,6 +133,36 @@ segunda o tercera edición por Thomas et al [The Pragmatic Programmers 2005-2008
no pueden tener un receptor explícito. En el caso anterior +today+ sería
el receptor explícito.
+
+* _singleton class (metaclase)_
+
+ Cualquier objeto en Ruby puede tener una aunque solamente son creadas cuando
+ es necesario. La singleton clase tiene las tablas de métodos y constantes
+ que preñen a una instancia (objeto) en particular. Por ejemplo, el método
+ +hello+ definido a continuación existe solamente en la singleton clase de
+ +obj+.
+
+ obj = Object.new
+ def obj.hello
+ puts 'hi'
+ end
+
+ Ya que las clases en Ruby también son objetos, estas pueden tener singleton
+ clases. Los métodos de clase (*class methods*) son simplemente métodos en
+ la tabla de métodos de la singleton clase de la clase. El método +honk+
+ existe en la singleton clase de la clase +Car+.
+
+ class Car
+ def self.honk
+ end
+ end
+
+ Todas las singleton clases en Rubinius son instancias de la clase
+ SingletonClass. La singleton clase para un objeto puede ser obtenida
+ llamando al método +singleton_class+. Los conceptos mencionados aquí se
+ conocen como el 'Meta-Object Protocol' o +MOP+.
+
+
* _superclass (superclase)_
La clase de la cual una clase en particular hereda. La clase Object es la
View
133 web/doc/ja/appendix-a-glossary.markdown
@@ -16,81 +16,52 @@ Guide" 2nd or 3rd Edition by Thomas et al [The Pragmatic Programmers
2005-2008]
-* _metaclass_
-
- Also called the +singleton+ class or +eigenclass+. Every object in Ruby can
- have one, although they are only created as necessary. The metaclass holds the
- method and constant tables that belong only to a particular object instance.
- For example, the method +hello+ defined below exists only in the metaclass for
- +obj+.
-
- obj = Object.new
- def obj.hello
- puts 'hi'
- end
-
- Since all classes in Ruby are also objects, they can have metaclasses. The
- methods called "class methods" are just methods in the method_table of the
- class's metaclass. The method +honk+ exists in the metaclass for the class
- +Car+.
-
- class Car
- def self.honk
- end
- end
-
- In Rubinius, metaclasses are all instances of the class MetaClass. The
- metaclass for an object can be obtained by calling the +metaclass+ method.
- The overall arrangement of concepts involved here is sometimes referred to
- as the 'Meta-Object Protocol' or +MOP+.
-
-
* _method lookup or method resolution_
The rule is simple: Take the object located in the class slot of the object
(which is not always the return value of Object#class; if the object has one,
- it'll be the metaclass) and begin searching.
+ it'll be the singleton class) and begin searching.
Searching goes up the superclass chain until the superclass is nil.
In which case, redo lookup for method_missing. If we fail to find
method_missing, fail tragically.
- +-------------+
- | nil |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Object |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Module |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Class |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | MetaClass |
- | (Object) |
- +-------------+
- ^
- | superclass
- |
- +-------------+ +-------------+
- | F | -----------------> | MetaClass |
- +-------------+ metaclass | (F) |
- +-------------+
+ +----------------+
+ | nil |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Object |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Module |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Class |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | SingletonClass |
+ | (Object) |
+ +----------------+
+ ^
+ | superclass
+ |
+ +-------------+ +----------------+
+ | F | -----------------> | SingletonClass |
+ +-------------+ singleton class | (F) |
+ +----------------+
class Class
@@ -107,8 +78,8 @@ Guide" 2nd or 3rd Edition by Thomas et al [The Pragmatic Programmers
1. Resolve method 'wanker' -- search method_tables in:
- 1. MetaClass(F)
- 1. MetaClass(Object)
+ 1. SingletonClass(F)
+ 1. SingletonClass(Object)
1. Class
Found
@@ -163,6 +134,34 @@ Guide" 2nd or 3rd Edition by Thomas et al [The Pragmatic Programmers
receiver.
+* _singleton class_
+
+ Every object in Ruby can have one, although they are only created as
+ necessary. The singleton class holds the method and constant tables that
+ belong only to a particular object instance. For example, the method
+ +hello+ defined below exists only in the singleton class for +obj+.
+
+ obj = Object.new
+ def obj.hello
+ puts 'hi'
+ end
+
+ Since all classes in Ruby are also objects, they can have singleton classes.
+ The methods called "class methods" are just methods in the method_table of
+ the class's singleton class. The method +honk+ exists in the singleton class
+ for the class +Car+.
+
+ class Car
+ def self.honk
+ end
+ end
+
+ In Rubinius, singleton classes are all instances of the class
+ SingletonClass. The singleton class for an object can be obtained by calling
+ the +singleton_class+ method. The overall arrangement of concepts involved
+ here is sometimes referred to as the 'Meta-Object Protocol' or +MOP+.
+
+
* _superclass_
The class that a particular class immediately inherits from. The class Object
View
133 web/doc/pl/appendix-a-glossary.markdown
@@ -15,81 +15,52 @@ Guide" 2nd or 3rd Edition by Thomas et al [The Pragmatic Programmers
2005-2008]
-* _metaclass_
-
- Also called the +singleton+ class or +eigenclass+. Every object in Ruby can
- have one, although they are only created as necessary. The metaclass holds the
- method and constant tables that belong only to a particular object instance.
- For example, the method +hello+ defined below exists only in the metaclass for
- +obj+.
-
- obj = Object.new
- def obj.hello
- puts 'hi'
- end
-
- Since all classes in Ruby are also objects, they can have metaclasses. The
- methods called "class methods" are just methods in the method_table of the
- class's metaclass. The method +honk+ exists in the metaclass for the class
- +Car+.
-
- class Car
- def self.honk
- end
- end
-
- In Rubinius, metaclasses are all instances of the class MetaClass. The
- metaclass for an object can be obtained by calling the +metaclass+ method.
- The overall arrangement of concepts involved here is sometimes referred to
- as the 'Meta-Object Protocol' or +MOP+.
-
-
* _method lookup or method resolution_
The rule is simple: Take the object located in the class slot of the object
(which is not always the return value of Object#class; if the object has one,
- it'll be the metaclass) and begin searching.
+ it'll be the singleton class) and begin searching.
Searching goes up the superclass chain until the superclass is nil.
In which case, redo lookup for method_missing. If we fail to find
method_missing, fail tragically.
- +-------------+
- | nil |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Object |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Module |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Class |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | MetaClass |
- | (Object) |
- +-------------+
- ^
- | superclass
- |
- +-------------+ +-------------+
- | F | -----------------> | MetaClass |
- +-------------+ metaclass | (F) |
- +-------------+
+ +----------------+
+ | nil |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Object |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Module |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Class |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | SingletonClass |
+ | (Object) |
+ +----------------+
+ ^
+ | superclass
+ |
+ +-------------+ +----------------+
+ | F | -----------------> | SingletonClass |
+ +-------------+ singleton class | (F) |
+ +----------------+
class Class
@@ -106,8 +77,8 @@ Guide" 2nd or 3rd Edition by Thomas et al [The Pragmatic Programmers
1. Resolve method 'wanker' -- search method_tables in:
- 1. MetaClass(F)
- 1. MetaClass(Object)
+ 1. SingletonClass(F)
+ 1. SingletonClass(Object)
1. Class
Found
@@ -162,6 +133,34 @@ Guide" 2nd or 3rd Edition by Thomas et al [The Pragmatic Programmers
receiver.
+* _singleton class_
+
+ Every object in Ruby can have one, although they are only created as
+ necessary. The singleton class holds the method and constant tables that
+ belong only to a particular object instance. For example, the method
+ +hello+ defined below exists only in the singleton class for +obj+.
+
+ obj = Object.new
+ def obj.hello
+ puts 'hi'
+ end
+
+ Since all classes in Ruby are also objects, they can have singleton classes.
+ The methods called "class methods" are just methods in the method_table of
+ the class's singleton class. The method +honk+ exists in the singleton class
+ for the class +Car+.
+
+ class Car
+ def self.honk
+ end
+ end
+
+ In Rubinius, singleton classes are all instances of the class
+ SingletonClass. The singleton class for an object can be obtained by calling
+ the +singleton_class+ method. The overall arrangement of concepts involved
+ here is sometimes referred to as the 'Meta-Object Protocol' or +MOP+.
+
+
* _superclass_
The class that a particular class immediately inherits from. The class Object
View
70 web/doc/ru/appendix-a-glossary.markdown
@@ -56,41 +56,41 @@ Programmers 2005-2008]
В этом случае повторяется поиск для метода method_missing. Если и этот
метод не будет найден -- трагедия.
- +-------------+
- | nil |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Object |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Module |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | Class |
- +-------------+
- ^
- | superclass
- |
- +-------------+
- | MetaClass |
- | (Object) |
- +-------------+
- ^
- | superclass
- |
- +-------------+ +-------------+
- | F | -----------------> | MetaClass |
- +-------------+ metaclass | (F) |
- +-------------+
+ +----------------+
+ | nil |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Object |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Module |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | Class |
+ +----------------+
+ ^
+ | superclass
+ |
+ +----------------+
+ | SingletonClass |
+ | (Object) |
+ +----------------+
+ ^
+ | superclass
+ |
+ +-------------+ +----------------+
+ | F | -----------------> | SingletonClass |
+ +-------------+ singleton class | (F) |
+ +----------------+
class Class
Please sign in to comment.
Something went wrong with that request. Please try again.