Class: EventHub::MessageProcessor
- Inherits:
-
Object
- Object
- EventHub::MessageProcessor
- Defined in:
- lib/eventhub/message_processor.rb
Instance Attribute Summary collapse
-
#processor ⇒ Object
readonly
Returns the value of attribute processor.
Instance Method Summary collapse
-
#initialize(processor) ⇒ MessageProcessor
constructor
A new instance of MessageProcessor.
- #process(params, payload) ⇒ Object
Constructor Details
#initialize(processor) ⇒ MessageProcessor
Returns a new instance of MessageProcessor.
4 5 6 |
# File 'lib/eventhub/message_processor.rb', line 4 def initialize(processor) @processor = processor end |
Instance Attribute Details
#processor ⇒ Object (readonly)
Returns the value of attribute processor.
2 3 4 |
# File 'lib/eventhub/message_processor.rb', line 2 def processor @processor end |
Instance Method Details
#process(params, payload) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/eventhub/message_processor.rb', line 8 def process(params, payload) = [] # check if payload is an array if payload.kind_of?(Array) payload.each do || << handle(params, .to_json) end else = handle(params, payload) end end |