Class: Work_smarter
- Inherits:
-
Struct
- Object
- Struct
- Work_smarter
- Defined in:
- lib/work_smarter.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#func ⇒ Object
Returns the value of attribute func.
-
#obj ⇒ Object
Returns the value of attribute obj.
Class Method Summary collapse
-
.queue(obj, func, args = []) ⇒ Object
delayed_job wrapper, creates a new monitored job and queues it.
Instance Method Summary collapse
-
#perform ⇒ Object
nothing of note here.
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args
1 2 3 |
# File 'lib/work_smarter.rb', line 1 def args @args end |
#func ⇒ Object
Returns the value of attribute func
1 2 3 |
# File 'lib/work_smarter.rb', line 1 def func @func end |
#obj ⇒ Object
Returns the value of attribute obj
1 2 3 |
# File 'lib/work_smarter.rb', line 1 def obj @obj end |
Class Method Details
.queue(obj, func, args = []) ⇒ Object
delayed_job wrapper, creates a new monitored job and queues it
3 4 5 6 |
# File 'lib/work_smarter.rb', line 3 def self.queue(obj, func, args = []) Work_smarter.configure unless defined?(@@config) Delayed::Job.enqueue Work_smarter.new(obj, func, args) end |
Instance Method Details
#perform ⇒ Object
nothing of note here
9 10 11 |
# File 'lib/work_smarter.rb', line 9 def perform obj.send(func, args) end |