Remove class_eval usage in Workers::Base

This commit is contained in:
Thibault Jouan 2015-04-18 14:40:12 +00:00
parent 1cb7086713
commit f94f9e2aed

View File

@ -13,11 +13,13 @@ module Uh
end
CALLBACKS.each do |m|
class_eval <<-eoh
def #{m} &block
if block_given? then @#{m} = block else @#{m} end
end
eoh
define_method m do |*_, &block|
if block
instance_variable_set "@#{m}".to_sym, block
else
instance_variable_get "@#{m}".to_sym
end
end
end
end
end