Module: Resque::Plugins::Progress

Defined in:
lib/resque/plugins/progress.rb,
lib/resque/plugins/progress/version.rb

Defined Under Namespace

Modules: Metadata

Constant Summary collapse

Version =
'1.0.1'

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(mod) ⇒ Object



6
7
8
9
# File 'lib/resque/plugins/progress.rb', line 6

def self.extended(mod)
  mod.extend(Resque::Plugins::Meta)
  Resque::Plugins::Meta::Metadata.send(:include, Resque::Plugins::Progress::Metadata)
end

Instance Method Details

#at(num, total, message = nil) ⇒ Object



11
12
13
14
15
16
# File 'lib/resque/plugins/progress.rb', line 11

def at(num, total, message = nil)
  if meta = get_meta(@meta_id)
    meta.progress = [num, total, message]
    meta.save
  end
end

#before_perform_progress(meta_id, *args) ⇒ Object



18
19
20
# File 'lib/resque/plugins/progress.rb', line 18

def before_perform_progress(meta_id, *args)
  @meta_id = meta_id
end