Skip to content

Commit

Permalink
mruby: use "def self.XXX" style for defining class method
Browse files Browse the repository at this point in the history
Because "class << self; def XXX" style can't find class variable.
It may be a mruby bug. I reported it:
mruby/mruby#2515
  • Loading branch information
kou committed Aug 7, 2014
1 parent ba1e077 commit b987232
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions lib/mrb/scripts/context/error_level.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions lib/mrb/scripts/context/rc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b987232

Please sign in to comment.