Permalink
Browse files

using attr_writer rather than defining our own writers

  • Loading branch information...
1 parent e4a2317 commit 25d11d8d368849f0ea7e01af43bcda5289fca157 @tenderlove tenderlove committed Feb 28, 2012
Showing with 3 additions and 9 deletions.
  1. +3 −9 lib/resque.rb
View
@@ -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}"

0 comments on commit 25d11d8

Please sign in to comment.