Module: Resque::Plugins::Progress::Metadata

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

Instance Method Summary collapse

Instance Method Details

#progressObject



23
24
25
26
# File 'lib/resque/plugins/progress.rb', line 23

def progress
  p = self['progress'] || [0, 1, nil]
  { :num => p[0].to_i, :total => p[1].to_i, :percent => 100*(p[0].to_f / p[1].to_i), :message => p[2] }
end

#progress=(p) ⇒ Object



28
29
30
# File 'lib/resque/plugins/progress.rb', line 28

def progress=(p)
  self['progress'] = p
end