summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-22 14:23:33 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-22 14:23:33 +0000
commit12d2c8ba41edb5a02a7471e39d67ece2894492d8 (patch)
tree5b2e87ac380efcb2141c4fab97e86c25c7214799 /object.c
parent624d07b0e4257a5261558a154eddd464d85e6174 (diff)
stripped trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r--object.c288
1 files changed, 144 insertions, 144 deletions
diff --git a/object.c b/object.c
index 39bab324dc..8ebb86a7bc 100644
--- a/object.c
+++ b/object.c
@@ -36,7 +36,7 @@ static ID id_eq, id_eql, id_match, id_inspect, id_init_copy;
/*
* call-seq:
* obj === other => true or false
- *
+ *
* Case Equality---For class <code>Object</code>, effectively the same
* as calling <code>#==</code>, but typically overridden by descendents
* to provide meaningful semantics in <code>case</code> statements.
@@ -64,7 +64,7 @@ rb_eql(VALUE obj1, VALUE obj2)
* obj == other => true or false
* obj.equal?(other) => true or false
* obj.eql?(other) => true or false
- *
+ *
* Equality---At the <code>Object</code> level, <code>==</code> returns
* <code>true</code> only if <i>obj</i> and <i>other</i> are the
* same object. Typically, this method is overridden in descendent
@@ -83,7 +83,7 @@ rb_eql(VALUE obj1, VALUE obj2)
* there are exceptions. <code>Numeric</code> types, for example,
* perform type conversion across <code>==</code>, but not across
* <code>eql?</code>, so:
- *
+ *
* 1 == 1.0 #=> true
* 1.eql? 1.0 #=> false
*/
@@ -144,13 +144,13 @@ rb_class_real(VALUE cl)
/*
* call-seq:
* obj.class => class
- *
+ *
* Returns the class of <i>obj</i>, now preferred over
* <code>Object#type</code>, as an object's type in Ruby is only
* loosely tied to that object's class. This method must always be
* called with an explicit receiver, as <code>class</code> is also a
* reserved word in Ruby.
- *
+ *
* 1.class #=> Fixnum
* self.class #=> Object
*/
@@ -210,12 +210,12 @@ init_copy(VALUE dest, VALUE obj)
/*
* call-seq:
* obj.clone -> an_object
- *
+ *
* Produces a shallow copy of <i>obj</i>---the instance variables of
* <i>obj</i> are copied, but not the objects they reference. Copies
* the frozen and tainted state of <i>obj</i>. See also the discussion
* under <code>Object#dup</code>.
- *
+ *
* class Klass
* attr_accessor :str
* end
@@ -251,7 +251,7 @@ rb_obj_clone(VALUE obj)
/*
* call-seq:
* obj.dup -> an_object
- *
+ *
* Produces a shallow copy of <i>obj</i>---the instance variables of
* <i>obj</i> are copied, but not the objects they reference.
* <code>dup</code> copies the tainted state of <i>obj</i>. See also
@@ -295,7 +295,7 @@ rb_obj_init_copy(VALUE obj, VALUE orig)
/*
* call-seq:
* obj.to_s => string
- *
+ *
* Returns a string representing <i>obj</i>. The default
* <code>to_s</code> prints the object's class and an encoding of the
* object id. As a special case, the top-level object that is the
@@ -365,11 +365,11 @@ inspect_obj(VALUE obj, VALUE str, int recur)
/*
* call-seq:
* obj.inspect => string
- *
+ *
* Returns a string containing a human-readable representation of
* <i>obj</i>. If not overridden, uses the <code>to_s</code> method to
* generate the string.
- *
+ *
* [ 1, 2, 3..4, 'five' ].inspect #=> "[1, 2, 3..4, \"five\"]"
* Time.new.inspect #=> "2008-03-08 19:43:39 +0900"
*/
@@ -407,7 +407,7 @@ rb_obj_inspect(VALUE obj)
/*
* call-seq:
* obj.instance_of?(class) => true or false
- *
+ *
* Returns <code>true</code> if <i>obj</i> is an instance of the given
* class. See also <code>Object#kind_of?</code>.
*/
@@ -433,11 +433,11 @@ rb_obj_is_instance_of(VALUE obj, VALUE c)
* call-seq:
* obj.is_a?(class) => true or false
* obj.kind_of?(class) => true or false
- *
+ *
* Returns <code>true</code> if <i>class</i> is the class of
* <i>obj</i>, or if <i>class</i> is one of the superclasses of
* <i>obj</i> or modules included in <i>obj</i>.
- *
+ *
* module M; end
* class A
* include M
@@ -482,7 +482,7 @@ rb_obj_is_kind_of(VALUE obj, VALUE c)
/*
* call-seq:
* obj.tap{|x|...} => obj
- *
+ *
* Yields <code>x</code> to the block, and then returns <code>x</code>.
* The primary purpose of this method is to "tap into" a method chain,
* in order to perform operations on intermediate results within the chain.
@@ -535,10 +535,10 @@ rb_obj_tap(VALUE obj)
*
* call-seq:
* singleton_method_added(symbol)
- *
+ *
* Invoked as a callback whenever a singleton method is added to the
* receiver.
- *
+ *
* module Chatty
* def Chatty.singleton_method_added(id)
* puts "Adding #{id.id2name}"
@@ -547,13 +547,13 @@ rb_obj_tap(VALUE obj)
* def two() end
* def Chatty.three() end
* end
- *
+ *
* <em>produces:</em>
- *
+ *
* Adding singleton_method_added
* Adding one
* Adding three
- *
+ *
*/
/*
@@ -561,10 +561,10 @@ rb_obj_tap(VALUE obj)
*
* call-seq:
* singleton_method_removed(symbol)
- *
+ *
* Invoked as a callback whenever a singleton method is removed from
* the receiver.
- *
+ *
* module Chatty
* def Chatty.singleton_method_removed(id)
* puts "Removing #{id.id2name}"
@@ -577,9 +577,9 @@ rb_obj_tap(VALUE obj)
* remove_method :one
* end
* end
- *
+ *
* <em>produces:</em>
- *
+ *
* Removing three
* Removing one
*/
@@ -589,10 +589,10 @@ rb_obj_tap(VALUE obj)
*
* call-seq:
* singleton_method_undefined(symbol)
- *
+ *
* Invoked as a callback whenever a singleton method is undefined in
* the receiver.
- *
+ *
* module Chatty
* def Chatty.singleton_method_undefined(id)
* puts "Undefining #{id.id2name}"
@@ -602,9 +602,9 @@ rb_obj_tap(VALUE obj)
* undef_method(:one)
* end
* end
- *
+ *
* <em>produces:</em>
- *
+ *
* Undefining one
*/
@@ -644,7 +644,7 @@ rb_obj_dummy(void)
/*
* call-seq:
* obj.tainted? => true or false
- *
+ *
* Returns <code>true</code> if the object is tainted.
*/
@@ -659,7 +659,7 @@ rb_obj_tainted(VALUE obj)
/*
* call-seq:
* obj.taint -> obj
- *
+ *
* Marks <i>obj</i> as tainted---if the <code>$SAFE</code> level is
* set appropriately, many method calls which might alter the running
* programs environment will refuse to accept tainted strings.
@@ -682,7 +682,7 @@ rb_obj_taint(VALUE obj)
/*
* call-seq:
* obj.untaint => obj
- *
+ *
* Removes the taint from <i>obj</i>.
*/
@@ -702,7 +702,7 @@ rb_obj_untaint(VALUE obj)
/*
* call-seq:
* obj.untrusted? => true or false
- *
+ *
* Returns <code>true</code> if the object is untrusted.
*/
@@ -717,7 +717,7 @@ rb_obj_untrusted(VALUE obj)
/*
* call-seq:
* obj.untrust -> obj
- *
+ *
* Marks <i>obj</i> as untrusted.
*/
@@ -738,7 +738,7 @@ rb_obj_untrust(VALUE obj)
/*
* call-seq:
* obj.trust => obj
- *
+ *
* Removes the untrusted mark from <i>obj</i>.
*/
@@ -766,18 +766,18 @@ static st_table *immediate_frozen_tbl = 0;
/*
* call-seq:
* obj.freeze => obj
- *
+ *
* Prevents further modifications to <i>obj</i>. A
* <code>RuntimeError</code> will be raised if modification is attempted.
* There is no way to unfreeze a frozen object. See also
* <code>Object#frozen?</code>.
- *
+ *
* a = [ "a", "b", "c" ]
* a.freeze
* a << "z"
- *
+ *
* <em>produces:</em>
- *
+ *
* prog.rb:3:in `<<': can't modify frozen array (RuntimeError)
* from prog.rb:3
*/
@@ -803,9 +803,9 @@ rb_obj_freeze(VALUE obj)
/*
* call-seq:
* obj.frozen? => true or false
- *
+ *
* Returns the freeze status of <i>obj</i>.
- *
+ *
* a = [ "a", "b", "c" ]
* a.freeze #=> ["a", "b", "c"]
* a.frozen? #=> true
@@ -832,9 +832,9 @@ rb_obj_frozen_p(VALUE obj)
/*
* call-seq:
* nil.to_i => 0
- *
+ *
* Always returns zero.
- *
+ *
* nil.to_i #=> 0
*/
@@ -848,9 +848,9 @@ nil_to_i(VALUE obj)
/*
* call-seq:
* nil.to_f => 0.0
- *
+ *
* Always returns zero.
- *
+ *
* nil.to_f #=> 0.0
*/
@@ -863,7 +863,7 @@ nil_to_f(VALUE obj)
/*
* call-seq:
* nil.to_s => ""
- *
+ *
* Always returns the empty string.
*/
@@ -878,9 +878,9 @@ nil_to_s(VALUE obj)
*
* call-seq:
* nil.to_a => []
- *
+ *
* Always returns an empty array.
- *
+ *
* nil.to_a #=> []
*/
@@ -930,7 +930,7 @@ true_to_s(VALUE obj)
/*
* call-seq:
* true & obj => true or false
- *
+ *
* And---Returns <code>false</code> if <i>obj</i> is
* <code>nil</code> or <code>false</code>, <code>true</code> otherwise.
*/
@@ -944,16 +944,16 @@ true_and(VALUE obj, VALUE obj2)
/*
* call-seq:
* true | obj => true
- *
+ *
* Or---Returns <code>true</code>. As <i>anObject</i> is an argument to
* a method call, it is always evaluated; there is no short-circuit
* evaluation in this case.
- *
+ *
* true | puts("or")
* true || puts("logical or")
- *
+ *
* <em>produces:</em>
- *
+ *
* or
*/
@@ -967,7 +967,7 @@ true_or(VALUE obj, VALUE obj2)
/*
* call-seq:
* true ^ obj => !obj
- *
+ *
* Exclusive Or---Returns <code>true</code> if <i>obj</i> is
* <code>nil</code> or <code>false</code>, <code>false</code>
* otherwise.
@@ -987,7 +987,7 @@ true_xor(VALUE obj, VALUE obj2)
* <code>FalseClass</code> and represents a logically false value in
* boolean expressions. The class provides operators allowing
* <code>false</code> to participate correctly in logical expressions.
- *
+ *
*/
/*
@@ -1007,7 +1007,7 @@ false_to_s(VALUE obj)
* call-seq:
* false & obj => false
* nil & obj => false
- *
+ *
* And---Returns <code>false</code>. <i>obj</i> is always
* evaluated as it is the argument to a method call---there is no
* short-circuit evaluation in this case.
@@ -1024,7 +1024,7 @@ false_and(VALUE obj, VALUE obj2)
* call-seq:
* false | obj => true or false
* nil | obj => true or false
- *
+ *
* Or---Returns <code>false</code> if <i>obj</i> is
* <code>nil</code> or <code>false</code>; <code>true</code> otherwise.
*/
@@ -1041,11 +1041,11 @@ false_or(VALUE obj, VALUE obj2)
* call-seq:
* false ^ obj => true or false
* nil ^ obj => true or false
- *
+ *
* Exclusive Or---If <i>obj</i> is <code>nil</code> or
* <code>false</code>, returns <code>false</code>; otherwise, returns
* <code>true</code>.
- *
+ *
*/
static VALUE
@@ -1086,7 +1086,7 @@ rb_false(VALUE obj)
/*
* call-seq:
* obj =~ other => nil
- *
+ *
* Pattern Match---Overridden by descendents (notably
* <code>Regexp</code> and <code>String</code>) to provide meaningful
* pattern-match semantics.
@@ -1101,7 +1101,7 @@ rb_obj_match(VALUE obj1, VALUE obj2)
/*
* call-seq:
* obj !~ other => true or false
- *
+ *
* Returns true if two objects do not match (using the <i>=~</i>
* method), otherwise false.
*/
@@ -1124,11 +1124,11 @@ rb_obj_not_match(VALUE obj1, VALUE obj2)
* included, module methods do not. Conversely, module methods may be
* called without creating an encapsulating object, while instance
* methods may not. (See <code>Module#module_function</code>)
- *
+ *
* In the descriptions that follow, the parameter <i>syml</i> refers
* to a symbol, which is either a quoted string or a
* <code>Symbol</code> (such as <code>:name</code>).
- *
+ *
* module Mod
* include Math
* CONST = 1
@@ -1139,7 +1139,7 @@ rb_obj_not_match(VALUE obj1, VALUE obj2)
* Mod.class #=> Module
* Mod.constants #=> [:CONST, :PI, :E]
* Mod.instance_methods #=> [:meth]
- *
+ *
*/
/*
@@ -1177,7 +1177,7 @@ rb_mod_to_s(VALUE klass)
/*
* call-seq:
* mod.freeze
- *
+ *
* Prevents further modifications to <i>mod</i>.
*/
@@ -1191,7 +1191,7 @@ rb_mod_freeze(VALUE mod)
/*
* call-seq:
* mod === obj => true or false
- *
+ *
* Case Equality---Returns <code>true</code> if <i>anObject</i> is an
* instance of <i>mod</i> or one of <i>mod</i>'s descendents. Of
* limited use for modules, but can be used in <code>case</code>
@@ -1209,9 +1209,9 @@ rb_mod_eqq(VALUE mod, VALUE arg)
* mod <= other => true, false, or nil
*
* Returns true if <i>mod</i> is a subclass of <i>other</i> or
- * is the same as <i>other</i>. Returns
- * <code>nil</code> if there's no relationship between the two.
- * (Think of the relationship in terms of the class definition:
+ * is the same as <i>other</i>. Returns
+ * <code>nil</code> if there's no relationship between the two.
+ * (Think of the relationship in terms of the class definition:
* "class A<B" implies "A<B").
*
*/
@@ -1247,9 +1247,9 @@ rb_class_inherited_p(VALUE mod, VALUE arg)
* call-seq:
* mod < other => true, false, or nil
*
- * Returns true if <i>mod</i> is a subclass of <i>other</i>. Returns
- * <code>nil</code> if there's no relationship between the two.
- * (Think of the relationship in terms of the class definition:
+ * Returns true if <i>mod</i> is a subclass of <i>other</i>. Returns
+ * <code>nil</code> if there's no relationship between the two.
+ * (Think of the relationship in terms of the class definition:
* "class A<B" implies "A<B").
*
*/
@@ -1267,9 +1267,9 @@ rb_mod_lt(VALUE mod, VALUE arg)
* mod >= other => true, false, or nil
*
* Returns true if <i>mod</i> is an ancestor of <i>other</i>, or the
- * two modules are the same. Returns
- * <code>nil</code> if there's no relationship between the two.
- * (Think of the relationship in terms of the class definition:
+ * two modules are the same. Returns
+ * <code>nil</code> if there's no relationship between the two.
+ * (Think of the relationship in terms of the class definition:
* "class A<B" implies "B>A").
*
*/
@@ -1292,9 +1292,9 @@ rb_mod_ge(VALUE mod, VALUE arg)
* call-seq:
* mod > other => true, false, or nil
*
- * Returns true if <i>mod</i> is an ancestor of <i>other</i>. Returns
- * <code>nil</code> if there's no relationship between the two.
- * (Think of the relationship in terms of the class definition:
+ * Returns true if <i>mod</i> is an ancestor of <i>other</i>. Returns
+ * <code>nil</code> if there's no relationship between the two.
+ * (Think of the relationship in terms of the class definition:
* "class A<B" implies "B>A").
*
*/
@@ -1309,7 +1309,7 @@ rb_mod_gt(VALUE mod, VALUE arg)
/*
* call-seq:
* mod <=> other_mod => -1, 0, +1, or nil
- *
+ *
* Comparison---Returns -1 if <i>mod</i> includes <i>other_mod</i>, 0 if
* <i>mod</i> is the same as <i>other_mod</i>, and +1 if <i>mod</i> is
* included by <i>other_mod</i> or if <i>mod</i> has no relationship with
@@ -1358,11 +1358,11 @@ rb_class_s_alloc(VALUE klass)
* call-seq:
* Module.new => mod
* Module.new {|mod| block } => mod
- *
+ *
* Creates a new anonymous module. If a block is given, it is passed
* the module object, and the block is evaluated in the context of this
* module using <code>module_eval</code>.
- *
+ *
* Fred = Module.new do
* def meth1
* "hello"
@@ -1391,11 +1391,11 @@ rb_mod_initialize(VALUE module)
/*
* call-seq:
* Class.new(super_class=Object) => a_class
- *
+ *
* Creates a new anonymous (unnamed) class with the given superclass
* (or <code>Object</code> if no parameter is given). You can give a
* class a name by assigning the class object to a constant.
- *
+ *
*/
static VALUE
@@ -1424,23 +1424,23 @@ rb_class_initialize(int argc, VALUE *argv, VALUE klass)
/*
* call-seq:
* class.allocate() => obj
- *
+ *
* Allocates space for a new object of <i>class</i>'s class and does not
* call initialize on the new instance. The returned object must be an
* instance of <i>class</i>.
- *
+ *
* klass = Class.new do
* def initialize(*args)
* @initialized = true
* end
- *
+ *
* def initialized?
* @initialized || false
* end
* end
- *
+ *
* klass.allocate.initialized? #=> false
- *
+ *
*/
VALUE
@@ -1472,13 +1472,13 @@ rb_class_allocate_instance(VALUE klass)
/*
* call-seq:
* class.new(args, ...) => obj
- *
+ *
* Calls <code>allocate</code> to create a new object of
* <i>class</i>'s class, then invokes that object's
* <code>initialize</code> method, passing it <i>args</i>.
* This is the method that ends up getting called whenever
* an object is constructed using .new.
- *
+ *
*/
VALUE
@@ -1495,9 +1495,9 @@ rb_class_new_instance(int argc, VALUE *argv, VALUE klass)
/*
* call-seq:
* class.superclass -> a_super_class or nil
- *
+ *
* Returns the superclass of <i>class</i>, or <code>nil</code>.
- *
+ *
* File.superclass #=> IO
* IO.superclass #=> Object
* Object.superclass #=> BasicObject
@@ -1508,7 +1508,7 @@ rb_class_new_instance(int argc, VALUE *argv, VALUE klass)
* returns nil when the given class hasn't a parent class:
*
* BasicObject.superclass #=> nil
- *
+ *
*/
static VALUE
@@ -1533,7 +1533,7 @@ rb_class_superclass(VALUE klass)
* call-seq:
* attr_reader(symbol, ...) => nil
* attr(symbol, ...) => nil
- *
+ *
* Creates instance variables and corresponding methods that return the
* value of each instance variable. Equivalent to calling
* ``<code>attr</code><i>:name</i>'' on each name in turn.
@@ -1564,7 +1564,7 @@ rb_mod_attr(int argc, VALUE *argv, VALUE klass)
/*
* call-seq:
* attr_writer(symbol, ...) => nil
- *
+ *
* Creates an accessor method to allow assignment to the attribute
* <i>aSymbol</i><code>.id2name</code>.
*/
@@ -1583,12 +1583,12 @@ rb_mod_attr_writer(int argc, VALUE *argv, VALUE klass)
/*
* call-seq:
* attr_accessor(symbol, ...) => nil
- *
+ *
* Defines a named attribute for this module, where the name is
* <i>symbol.</i><code>id2name</code>, creating an instance variable
* (<code>@name</code>) and a corresponding access method to read it.
* Also creates a method called <code>name=</code> to set the attribute.
- *
+ *
* module Mod
* attr_accessor(:one, :two)
* end
@@ -1609,9 +1609,9 @@ rb_mod_attr_accessor(int argc, VALUE *argv, VALUE klass)
/*
* call-seq:
* mod.const_get(sym, inherit=true) => obj
- *
+ *
* Returns the value of the named constant in <i>mod</i>.
- *
+ *
* Math.const_get(:PI) #=> 3.14159265358979
*
* If the constant is not defined or is defined by the ancestors and
@@ -1641,11 +1641,11 @@ rb_mod_const_get(int argc, VALUE *argv, VALUE mod)
/*
* call-seq:
* mod.const_set(sym, obj) => obj
- *
+ *
* Sets the named constant to the given object, returning that object.
* Creates a new constant if no constant with the given name previously
* existed.
- *
+ *
* Math.const_set("HIGH_SCHOOL_PI", 22.0/7.0) #=> 3.14285714285714
* Math::HIGH_SCHOOL_PI - Math::PI #=> 0.00126448926734968
*/
@@ -1665,10 +1665,10 @@ rb_mod_const_set(VALUE mod, VALUE name, VALUE value)
/*
* call-seq:
* mod.const_defined?(sym, inherit=true) => true or false
- *
+ *
* Returns <code>true</code> if a constant with the given name is
* defined by <i>mod</i>, or its ancestors if +inherit+ is not false.
- *
+ *
* Math.const_defined? "PI" #=> true
* IO.const_defined? "SYNC" #=> true
* IO.const_defined? "SYNC", false #=> false
@@ -1697,17 +1697,17 @@ rb_mod_const_defined(int argc, VALUE *argv, VALUE mod)
/*
* call-seq:
* obj.methods => array
- *
+ *
* Returns a list of the names of methods publicly accessible in
* <i>obj</i>. This will include all the methods accessible in
* <i>obj</i>'s ancestors.
- *
+ *
* class Klass
* def kMethod()
* end
* end
* k = Klass.new
- * k.methods[0..9] #=> ["kMethod", "freeze", "nil?", "is_a?",
+ * k.methods[0..9] #=> ["kMethod", "freeze", "nil?", "is_a?",
* # "class", "instance_variable_set",
* # "methods", "extend", "__send__", "instance_eval"]
* k.methods.length #=> 42
@@ -1738,7 +1738,7 @@ rb_obj_methods(int argc, VALUE *argv, VALUE obj)
/*
* call-seq:
* obj.protected_methods(all=true) => array
- *
+ *
* Returns the list of protected methods accessible to <i>obj</i>. If
* the <i>all</i> parameter is set to <code>false</code>, only those methods
* in the receiver will be listed.
@@ -1759,7 +1759,7 @@ rb_obj_protected_methods(int argc, VALUE *argv, VALUE obj)
/*
* call-seq:
* obj.private_methods(all=true) => array
- *
+ *
* Returns the list of private methods accessible to <i>obj</i>. If
* the <i>all</i> parameter is set to <code>false</code>, only those methods
* in the receiver will be listed.
@@ -1780,7 +1780,7 @@ rb_obj_private_methods(int argc, VALUE *argv, VALUE obj)
/*
* call-seq:
* obj.public_methods(all=true) => array
- *
+ *
* Returns the list of public methods accessible to <i>obj</i>. If
* the <i>all</i> parameter is set to <code>false</code>, only those methods
* in the receiver will be listed.
@@ -1807,7 +1807,7 @@ rb_obj_public_methods(int argc, VALUE *argv, VALUE obj)
* variable name should be included for regular instance
* variables. Throws a <code>NameError</code> exception if the
* supplied symbol is not valid as an instance variable name.
- *
+ *
* class Fred
* def initialize(p1, p2)
* @a, @b = p1, p2
@@ -1832,12 +1832,12 @@ rb_obj_ivar_get(VALUE obj, VALUE iv)
/*
* call-seq:
* obj.instance_variable_set(symbol, obj) => obj
- *
+ *
* Sets the instance variable names by <i>symbol</i> to
* <i>object</i>, thereby frustrating the efforts of the class's
* author to attempt to provide proper encapsulation. The variable
* did not have to exist prior to this call.
- *
+ *
* class Fred
* def initialize(p1, p2)
* @a, @b = p1, p2
@@ -1892,11 +1892,11 @@ rb_obj_ivar_defined(VALUE obj, VALUE iv)
/*
* call-seq:
* mod.class_variable_get(symbol) => obj
- *
+ *
* Returns the value of the given class variable (or throws a
* <code>NameError</code> exception). The <code>@@</code> part of the
* variable name should be included for regular class variables
- *
+ *
* class Fred
* @@foo = 99
* end
@@ -1917,10 +1917,10 @@ rb_mod_cvar_get(VALUE obj, VALUE iv)
/*
* call-seq:
* obj.class_variable_set(symbol, obj) => obj
- *
+ *
* Sets the class variable names by <i>symbol</i> to
* <i>object</i>.
- *
+ *
* class Fred
* @@foo = 99
* def foo
@@ -2004,7 +2004,7 @@ convert_type(VALUE val, const char *tname, const char *method, int raise)
NIL_P(val) ? "nil" :
val == Qtrue ? "true" :
val == Qfalse ? "false" :
- rb_obj_classname(val),
+ rb_obj_classname(val),
tname);
}
else {
@@ -2118,7 +2118,7 @@ rb_Integer(VALUE val)
/*
* call-seq:
* Integer(arg) => integer
- *
+ *
* Converts <i>arg</i> to a <code>Fixnum</code> or <code>Bignum</code>.
* Numeric types are converted directly (with floating point numbers
* being truncated). If <i>arg</i> is a <code>String</code>, leading
@@ -2126,7 +2126,7 @@ rb_Integer(VALUE val)
* <code>0x</code>) are honored. Others are converted using
* <code>to_int</code> and <code>to_i</code>. This behavior is
* different from that of <code>String#to_i</code>.
- *
+ *
* Integer(123.999) #=> 123
* Integer("0x1a") #=> 26
* Integer(Time.new) #=> 1204973019
@@ -2261,11 +2261,11 @@ rb_Float(VALUE val)
/*
* call-seq:
* Float(arg) => float
- *
+ *
* Returns <i>arg</i> converted to a float. Numeric types are converted
* directly, the rest are converted using <i>arg</i>.to_f. As of Ruby
* 1.8, converting <code>nil</code> generates a <code>TypeError</code>.
- *
+ *
* Float(1) #=> 1.0
* Float("123.456") #=> 123.456
*/
@@ -2322,10 +2322,10 @@ rb_String(VALUE val)
/*
* call-seq:
* String(arg) => string
- *
+ *
* Converts <i>arg</i> to a <code>String</code> by calling its
* <code>to_s</code> method.
- *
+ *
* String(self) #=> "main"
* String(self.class) #=> "Object"
* String(123456) #=> "123456"
@@ -2354,10 +2354,10 @@ rb_Array(VALUE val)
/*
* call-seq:
* Array(arg) => array
- *
+ *
* Returns <i>arg</i> as an <code>Array</code>. First tries to call
* <i>arg</i><code>.to_ary</code>, then <i>arg</i><code>.to_a</code>.
- *
+ *
* Array(1..5) #=> [1, 2, 3, 4, 5]
*/
@@ -2391,7 +2391,7 @@ boot_defmetametaclass(VALUE klass, VALUE metametaclass)
*
* Classes in Ruby are first-class objects---each is an instance of
* class <code>Class</code>.
- *
+ *
* When a new class is created (typically using <code>class Name ...
* end</code>), an object of type <code>Class</code> is created and
* assigned to a global constant (<code>Name</code> in this case). When
@@ -2399,7 +2399,7 @@ boot_defmetametaclass(VALUE klass, VALUE metametaclass)
* <code>new</code> method in <code>Class</code> is run by default.
* This can be demonstrated by overriding <code>new</code> in
* <code>Class</code>:
- *
+ *
* class Class
* alias oldNew new
* def new(*args)
@@ -2407,21 +2407,21 @@ boot_defmetametaclass(VALUE klass, VALUE metametaclass)
* oldNew(*args)
* end
* end
- *
- *
+ *
+ *
* class Name
* end
- *
- *
+ *
+ *
* n = Name.new
- *
+ *
* <em>produces:</em>
- *
+ *
* Creating a new Name
- *
+ *
* Classes, modules, and objects are interrelated. In the diagram
* that follows, the vertical arrows represent inheritance, and the
- * parentheses meta-classes. All metaclasses are instances
+ * parentheses meta-classes. All metaclasses are instances
* of the class `Class'.
*
* +-----------------+
@@ -2453,13 +2453,13 @@ boot_defmetametaclass(VALUE klass, VALUE metametaclass)
* class hierarchy is a direct subclass of <code>BasicObject</code>. Its
* methods are therefore available to all objects unless explicitly
* overridden.
- *
+ *
* <code>Object</code> mixes in the <code>Kernel</code> module, making
* the built-in kernel functions globally accessible. Although the
* instance methods of <code>Object</code> are defined by the
* <code>Kernel</code> module, we have chosen to document them here for
* clarity.
- *
+ *
* In the descriptions of Object's methods, the parameter <i>symbol</i> refers
* to a symbol, which is either a quoted string or a
* <code>Symbol</code> (such as <code>:name</code>).
@@ -2509,7 +2509,7 @@ Init_Object(void)
rb_define_private_method(rb_cModule, "method_undefined", rb_obj_dummy, 1);
rb_define_method(rb_mKernel, "nil?", rb_false, 0);
- rb_define_method(rb_mKernel, "===", rb_equal, 1);
+ rb_define_method(rb_mKernel, "===", rb_equal, 1);
rb_define_method(rb_mKernel, "=~", rb_obj_match, 1);
rb_define_method(rb_mKernel, "!~", rb_obj_not_match, 1);
rb_define_method(rb_mKernel, "eql?", rb_obj_equal, 1);
@@ -2595,24 +2595,24 @@ Init_Object(void)
rb_define_alloc_func(rb_cModule, rb_module_s_alloc);
rb_define_method(rb_cModule, "initialize", rb_mod_initialize, 0);
rb_define_method(rb_cModule, "instance_methods", rb_class_instance_methods, -1); /* in class.c */
- rb_define_method(rb_cModule, "public_instance_methods",
+ rb_define_method(rb_cModule, "public_instance_methods",
rb_class_public_instance_methods, -1); /* in class.c */
- rb_define_method(rb_cModule, "protected_instance_methods",
+ rb_define_method(rb_cModule, "protected_instance_methods",
rb_class_protected_instance_methods, -1); /* in class.c */
- rb_define_method(rb_cModule, "private_instance_methods",
+ rb_define_method(rb_cModule, "private_instance_methods",
rb_class_private_instance_methods, -1); /* in class.c */
rb_define_method(rb_cModule, "constants", rb_mod_constants, -1); /* in variable.c */
rb_define_method(rb_cModule, "const_get", rb_mod_const_get, -1);
rb_define_method(rb_cModule, "const_set", rb_mod_const_set, 2);
rb_define_method(rb_cModule, "const_defined?", rb_mod_const_defined, -1);
- rb_define_private_method(rb_cModule, "remove_const",
+ rb_define_private_method(rb_cModule, "remove_const",
rb_mod_remove_const, 1); /* in variable.c */
- rb_define_method(rb_cModule, "const_missing",
+ rb_define_method(rb_cModule, "const_missing",
rb_mod_const_missing, 1); /* in variable.c */
- rb_define_method(rb_cModule, "class_variables",
+ rb_define_method(rb_cModule, "class_variables",
rb_mod_class_variables, 0); /* in variable.c */
- rb_define_method(rb_cModule, "remove_class_variable",
+ rb_define_method(rb_cModule, "remove_class_variable",
rb_mod_remove_cvar, 1); /* in variable.c */
rb_define_method(rb_cModule, "class_variable_get", rb_mod_cvar_get, 1);
rb_define_method(rb_cModule, "class_variable_set", rb_mod_cvar_set, 2);