Class: EventBus::Listeners::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/event_bus/listeners/base.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(channel) ⇒ Base

Returns a new instance of Base.



6
7
8
# File 'lib/event_bus/listeners/base.rb', line 6

def initialize(channel)
  @channel = channel
end

Instance Attribute Details

#channelObject (readonly)

Returns the value of attribute channel.



4
5
6
# File 'lib/event_bus/listeners/base.rb', line 4

def channel
  @channel
end

Class Method Details

.bind(method, event_name) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/event_bus/listeners/base.rb', line 10

def self.bind(method, event_name)
  Manager.register_listener_configuration({
    listener_class: self,
    method: method,
    routing_key: event_name
  })
end