Module: Distribot::Worker::ClassMethods

Defined in:
lib/distribot/worker.rb

Class Attribute Summary collapse

Instance Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.enumeratorObject

Returns the value of attribute enumerator.



12
13
14
# File 'lib/distribot/worker.rb', line 12

def enumerator
  @enumerator
end

.process_tasks_withObject

Returns the value of attribute process_tasks_with.



12
13
14
# File 'lib/distribot/worker.rb', line 12

def process_tasks_with
  @process_tasks_with
end

.processorObject

Returns the value of attribute processor.



12
13
14
# File 'lib/distribot/worker.rb', line 12

def processor
  @processor
end

.versionObject

Returns the value of attribute version.



12
13
14
# File 'lib/distribot/worker.rb', line 12

def version
  @version
end

Instance Attribute Details

#enumeratorObject (readonly)

Returns the value of attribute enumerator.



15
16
17
# File 'lib/distribot/worker.rb', line 15

def enumerator
  @enumerator
end

#processorObject (readonly)

Returns the value of attribute processor.



15
16
17
# File 'lib/distribot/worker.rb', line 15

def processor
  @processor
end

Instance Method Details

#enumerate_with(callback) ⇒ Object



17
18
19
# File 'lib/distribot/worker.rb', line 17

def enumerate_with(callback)
  @enumerator = callback
end

#enumeration_queueObject



32
33
34
35
# File 'lib/distribot/worker.rb', line 32

def enumeration_queue
  self.version ||= '0.0.0'
  "distribot.flow.handler.#{self}.#{self.version}.enumerate"
end

#process_tasks_with(callback) ⇒ Object



21
22
23
# File 'lib/distribot/worker.rb', line 21

def process_tasks_with(callback)
  @processor = callback
end

#task_queueObject



37
38
39
40
# File 'lib/distribot/worker.rb', line 37

def task_queue
  self.version ||= '0.0.0'
  "distribot.flow.handler.#{self}.#{self.version}.tasks"
end

#version(val = nil) ⇒ Object

Does both setting/getting:



26
27
28
29
30
# File 'lib/distribot/worker.rb', line 26

def version(val = nil)
  @version ||= '0.0.0'
  @version = val unless val.nil?
  @version
end