Class: Afterparty::BasicJob
- Inherits:
-
Object
- Object
- Afterparty::BasicJob
- Defined in:
- lib/afterparty/jobs.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#method ⇒ Object
Returns the value of attribute method.
-
#object ⇒ Object
Returns the value of attribute object.
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(object, method, *args) ⇒ BasicJob
constructor
A new instance of BasicJob.
- #run ⇒ Object
Constructor Details
#initialize(object, method, *args) ⇒ BasicJob
Returns a new instance of BasicJob.
25 26 27 28 29 |
# File 'lib/afterparty/jobs.rb', line 25 def initialize object, method, *args @object = object @method = method @args = args end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
24 25 26 |
# File 'lib/afterparty/jobs.rb', line 24 def args @args end |
#method ⇒ Object
Returns the value of attribute method.
24 25 26 |
# File 'lib/afterparty/jobs.rb', line 24 def method @method end |
#object ⇒ Object
Returns the value of attribute object.
24 25 26 |
# File 'lib/afterparty/jobs.rb', line 24 def object @object end |
Instance Method Details
#description ⇒ Object
35 36 37 38 39 |
# File 'lib/afterparty/jobs.rb', line 35 def description desc = "Object: #{(@object || "nil")}." desc << "Method: #{(@method || nil)}." desc << "Args: #{(@args || nil)}" end |
#run ⇒ Object
31 32 33 |
# File 'lib/afterparty/jobs.rb', line 31 def run @object.send(:method, *@args) end |