[前][次][番号順一覧][スレッド一覧]

ruby-changes:22480

From: naruse <ko1@a...>
Date: Fri, 10 Feb 2012 05:13:44 +0900 (JST)
Subject: [ruby-changes:22480] naruse:r34529 (ruby_1_9_3): merge revision(s) 34277: [Backport #5881]

naruse	2012-02-10 05:13:30 +0900 (Fri, 10 Feb 2012)

  New Revision: 34529

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=34529

  Log:
    merge revision(s) 34277: [Backport #5881]
    
    * object.c: Added examples for Object#is_a? and
      Object#instance_of? patcheed from Manoj Kumar.
      [Bug #5880] [ruby-core:42057]

  Modified files:
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/object.c
    branches/ruby_1_9_3/version.h

Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 34528)
+++ ruby_1_9_3/ChangeLog	(revision 34529)
@@ -1,3 +1,9 @@
+Fri Feb 10 05:13:12 2012  Ayumu AIZAWA  <ayumu.aizawa@g...>
+
+	* object.c: Added examples for Object#is_a? and
+	  Object#instance_of? patcheed from Manoj Kumar.
+	  [Bug #5880] [ruby-core:42057]
+
 Fri Feb 10 05:11:43 2012  NARUSE, Yui  <naruse@r...>
 
 	* io.c (argf_next_argv): reset ARGF.next_p on ARGV.replace.
Index: ruby_1_9_3/object.c
===================================================================
--- ruby_1_9_3/object.c	(revision 34528)
+++ ruby_1_9_3/object.c	(revision 34529)
@@ -458,6 +458,15 @@
  *
  *  Returns <code>true</code> if <i>obj</i> is an instance of the given
  *  class. See also <code>Object#kind_of?</code>.
+ *
+ *     class A;     end
+ *     class B < A; end
+ *     class C < B; end
+ *
+ *     b = B.new
+ *     b.instance_of? A   #=> false
+ *     b.instance_of? B   #=> true
+ *     b.instance_of? C   #=> false
  */
 
 VALUE
@@ -492,11 +501,13 @@
  *     end
  *     class B < A; end
  *     class C < B; end
+ *
  *     b = B.new
- *     b.instance_of? A   #=> false
- *     b.instance_of? B   #=> true
- *     b.instance_of? C   #=> false
- *     b.instance_of? M   #=> false
+ *     b.is_a? A          #=> true
+ *     b.is_a? B          #=> true
+ *     b.is_a? C          #=> false
+ *     b.is_a? M          #=> true
+ *
  *     b.kind_of? A       #=> true
  *     b.kind_of? B       #=> true
  *     b.kind_of? C       #=> false
Index: ruby_1_9_3/version.h
===================================================================
--- ruby_1_9_3/version.h	(revision 34528)
+++ ruby_1_9_3/version.h	(revision 34529)
@@ -1,5 +1,5 @@
 #define RUBY_VERSION "1.9.3"
-#define RUBY_PATCHLEVEL 77
+#define RUBY_PATCHLEVEL 78
 
 #define RUBY_RELEASE_DATE "2012-02-10"
 #define RUBY_RELEASE_YEAR 2012

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]