Class: Octokiq::Processor

Inherits:
Object
  • Object
show all
Defined in:
lib/octokiq/processor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#argsObject

Returns the value of attribute args.



3
4
5
# File 'lib/octokiq/processor.rb', line 3

def args
  @args
end

#klassObject

Returns the value of attribute klass.



3
4
5
# File 'lib/octokiq/processor.rb', line 3

def klass
  @klass
end

Instance Method Details

#runObject



10
11
12
# File 'lib/octokiq/processor.rb', line 10

def run
  klass.new.perform(*args)
end