Sha256: 01cb74c422e92f415e020c758ffb7cb968be2507c40e243d673824eccf2aa6aa
Contents?: true
Size: 531 Bytes
Versions: 1
Compression:
Stored size: 531 Bytes
Contents
module ResqueScheduler module Plugin extend self def hooks(job, pattern) job.methods.grep(/^#{pattern}/).sort end def run_hooks(job, pattern, *args) results = hooks(job, pattern).collect do |hook| job.send(hook, *args) end results.all? { |result| result != false } end def method_missing(method_name, *args, &block) if method_name =~ /^run_(.*)_hooks$/ job = args.shift run_hooks job, $1, *args else super end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
resque-scheduler-2.0.0.h | lib/resque_scheduler/plugin.rb |