diff --git a/lib/resque.rb b/lib/resque.rb index 0bbfbf70a..4edf53cc5 100644 --- a/lib/resque.rb +++ b/lib/resque.rb @@ -77,9 +77,7 @@ def before_first_fork(&block) # Set a proc that will be called in the parent process before the # worker forks for the first time. - def before_first_fork=(before_first_fork) - @before_first_fork = before_first_fork - end + attr_writer :before_first_fork # The `before_fork` hook will be run in the **parent** process # before every job, so be careful- any changes you make will be @@ -92,9 +90,7 @@ def before_fork(&block) end # Set the before_fork proc. - def before_fork=(before_fork) - @before_fork = before_fork - end + attr_writer :before_fork # The `after_fork` hook will be run in the child process and is passed # the current job. Any changes you make, therefore, will only live as @@ -107,9 +103,7 @@ def after_fork(&block) end # Set the after_fork proc. - def after_fork=(after_fork) - @after_fork = after_fork - end + attr_writer :after_fork def to_s "Resque Client connected to #{redis_id}"