Class: Work_smarter

Inherits:
Struct
  • Object
show all
Defined in:
lib/work_smarter.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#argsObject

Returns the value of attribute args

Returns:

  • (Object)

    the current value of args



1
2
3
# File 'lib/work_smarter.rb', line 1

def args
  @args
end

#funcObject

Returns the value of attribute func

Returns:

  • (Object)

    the current value of func



1
2
3
# File 'lib/work_smarter.rb', line 1

def func
  @func
end

#objObject

Returns the value of attribute obj

Returns:

  • (Object)

    the current value of 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

#performObject

nothing of note here



9
10
11
# File 'lib/work_smarter.rb', line 9

def perform
  obj.send(func, args)
end