Class: Afterparty::BasicJob

Inherits:
Object
  • Object
show all
Defined in:
lib/afterparty/jobs.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#argsObject

Returns the value of attribute args.



24
25
26
# File 'lib/afterparty/jobs.rb', line 24

def args
  @args
end

#methodObject

Returns the value of attribute method.



24
25
26
# File 'lib/afterparty/jobs.rb', line 24

def method
  @method
end

#objectObject

Returns the value of attribute object.



24
25
26
# File 'lib/afterparty/jobs.rb', line 24

def object
  @object
end

Instance Method Details

#descriptionObject



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

#runObject



31
32
33
# File 'lib/afterparty/jobs.rb', line 31

def run
  @object.send(:method, *@args)
end