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

ruby-changes:15693

From: naruse <ko1@a...>
Date: Tue, 4 May 2010 17:08:40 +0900 (JST)
Subject: [ruby-changes:15693] Ruby:r27613 (trunk): Setup Symbol#to_json to avoid conflict.

naruse	2010-05-04 17:08:31 +0900 (Tue, 04 May 2010)

  New Revision: 27613

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

  Log:
    Setup Symbol#to_json to avoid conflict.

  Modified files:
    trunk/test/json/test_json_rails.rb

Index: test/json/test_json_rails.rb
===================================================================
--- test/json/test_json_rails.rb	(revision 27612)
+++ test/json/test_json_rails.rb	(revision 27613)
@@ -13,6 +13,14 @@
 class TC_JSONRails < Test::Unit::TestCase
   include JSON
 
+  def setup
+    Symbol.class_eval do
+      def to_json(*a)
+        to_s.to_json(*a)
+      end
+    end
+  end
+
   class A
     def initialize(a)
       @a = a

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

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