Class: Octokiq::Processor
- Inherits:
-
Object
- Object
- Octokiq::Processor
- Defined in:
- lib/octokiq/processor.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#klass ⇒ Object
Returns the value of attribute klass.
Instance Method Summary collapse
-
#initialize(job) ⇒ Processor
constructor
A new instance of Processor.
- #run ⇒ Object
Constructor Details
#initialize(job) ⇒ Processor
Returns a new instance of Processor.
4 5 6 7 8 |
# File 'lib/octokiq/processor.rb', line 4 def initialize(job) klass_name = job.fetch(Consts::ITEM_CLASS_KEY) @args = job.fetch(Consts::ITEM_ARGS_KEY) @klass = Object.const_get(klass_name) end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
3 4 5 |
# File 'lib/octokiq/processor.rb', line 3 def args @args end |
#klass ⇒ Object
Returns the value of attribute klass.
3 4 5 |
# File 'lib/octokiq/processor.rb', line 3 def klass @klass end |
Instance Method Details
#run ⇒ Object
10 11 12 |
# File 'lib/octokiq/processor.rb', line 10 def run klass.new.perform(*args) end |