Skip to content

Commit

Permalink
using attr_writer rather than defining our own writers
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Feb 28, 2012
1 parent e4a2317 commit 25d11d8
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions lib/resque.rb
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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}"
Expand Down

0 comments on commit 25d11d8

Please sign in to comment.