Permalink
Browse files

not relying on define_singleton_method anymore

  • Loading branch information...
1 parent 287ec74 commit 0b057800a561ed228292a9ad2db9de460f0c7358 Rob Hurring committed Mar 10, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/class_logger.rb
View
@@ -44,8 +44,9 @@ def setup_logger(options)
as = options[:as]
self.loggers[as] = _logger
+
define_method(as){ self.class.loggers[as] }
- define_singleton_method(as){ loggers[as] }
+ (class << self; self; end).class_eval{ define_method(as){ loggers[as] }}
end
end
end

0 comments on commit 0b05780

Please sign in to comment.