Class: MessageBusClient::MessageHandler::SubscribedChannel
- Inherits:
-
Struct
- Object
- Struct
- MessageBusClient::MessageHandler::SubscribedChannel
- Defined in:
- lib/message_bus_client/message_handler.rb
Instance Attribute Summary collapse
-
#callbacks ⇒ Object
Returns the value of attribute callbacks.
-
#last_id ⇒ Object
Returns the value of attribute last_id.
Instance Method Summary collapse
- #callback(payload, message_id) ⇒ Object
-
#initialize(last_id) ⇒ SubscribedChannel
constructor
A new instance of SubscribedChannel.
Constructor Details
#initialize(last_id) ⇒ SubscribedChannel
Returns a new instance of SubscribedChannel.
3 4 5 6 |
# File 'lib/message_bus_client/message_handler.rb', line 3 def initialize(last_id) self.callbacks = [] self.last_id = last_id end |
Instance Attribute Details
#callbacks ⇒ Object
Returns the value of attribute callbacks
2 3 4 |
# File 'lib/message_bus_client/message_handler.rb', line 2 def callbacks @callbacks end |
#last_id ⇒ Object
Returns the value of attribute last_id
2 3 4 |
# File 'lib/message_bus_client/message_handler.rb', line 2 def last_id @last_id end |
Instance Method Details
#callback(payload, message_id) ⇒ Object
8 9 10 11 12 |
# File 'lib/message_bus_client/message_handler.rb', line 8 def callback(payload, ) callbacks.each do |callback| callback.call(payload, ) end end |