[Groonga-commit] groonga/groonga at b987232 [master] mruby: use "def self.XXX" style for defining class method

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Aug 7 22:37:36 JST 2014


Kouhei Sutou	2014-08-07 22:37:36 +0900 (Thu, 07 Aug 2014)

  New Revision: b987232f389651f546b25903c5e9a9397c15918d
  https://github.com/groonga/groonga/commit/b987232f389651f546b25903c5e9a9397c15918d

  Message:
    mruby: use "def self.XXX" style for defining class method
    
    Because "class << self; def XXX" style can't find class variable.
    It may be a mruby bug. I reported it:
    https://github.com/mruby/mruby/issues/2515

  Modified files:
    lib/mrb/scripts/context/error_level.rb
    lib/mrb/scripts/context/rc.rb

  Modified: lib/mrb/scripts/context/error_level.rb (+2 -4)
===================================================================
--- lib/mrb/scripts/context/error_level.rb    2014-08-07 22:36:40 +0900 (fd6b877)
+++ lib/mrb/scripts/context/error_level.rb    2014-08-07 22:37:36 +0900 (a32becc)
@@ -2,10 +2,8 @@ module Groonga
   class Context
     class ErrorLevel
       @@names = {}
-      class << self
-        def find(name)
-          @@names[name]
-        end
+      def self.find(name)
+        @@names[name]
       end
 
       attr_reader :name

  Modified: lib/mrb/scripts/context/rc.rb (+2 -4)
===================================================================
--- lib/mrb/scripts/context/rc.rb    2014-08-07 22:36:40 +0900 (0897384)
+++ lib/mrb/scripts/context/rc.rb    2014-08-07 22:37:36 +0900 (b42b0e8)
@@ -2,10 +2,8 @@ module Groonga
   class Context
     class RC
       @@names = {}
-      class << self
-        def find(name)
-          @@names[name]
-        end
+      def self.find(name)
+        @@names[name]
       end
 
       attr_reader :name
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index