Module: SongkickQueue::Consumer

Defined in:
lib/songkick_queue/consumer.rb

Defined Under Namespace

Modules: ClassMethods

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#delivery_infoObject (readonly)

Returns the value of attribute delivery_info


3
4
5
# File 'lib/songkick_queue/consumer.rb', line 3

def delivery_info
  @delivery_info
end

#loggerObject (readonly)

Returns the value of attribute logger


3
4
5
# File 'lib/songkick_queue/consumer.rb', line 3

def logger
  @logger
end

Class Method Details

.included(base) ⇒ Object


22
23
24
# File 'lib/songkick_queue/consumer.rb', line 22

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#initialize(delivery_info, logger) ⇒ Object


29
30
31
32
# File 'lib/songkick_queue/consumer.rb', line 29

def initialize(delivery_info, logger)
  @delivery_info = delivery_info
  @logger        = logger
end

#process(message) ⇒ Object

Placeholder method to ensure each client consumer defines their own process message

Raises:

  • (NotImplementedError)

39
40
41
42
# File 'lib/songkick_queue/consumer.rb', line 39

def process(message)
  fail NotImplementedError, 'you must define a #process method in your ' +
    'consumer class, see the README for more info.'
end