Method: QueueMap::Consumer.from_file

Defined in:
lib/queue_map/consumer.rb

.from_file(consumer_path, options = { }) ⇒ Object



35
36
37
38
39
40
# File 'lib/queue_map/consumer.rb', line 35

def self.from_file(consumer_path, options = { })
  name = File.basename(consumer_path).gsub(/_consumer\.rb$/, '').to_sym
  consumer = new(name, options)
  Configurator.new(consumer).instance_eval(File.read(consumer_path), consumer_path, 1)
  consumer
end