Class: Chickadee::MessageBus::Subscriber

Inherits:
Object
  • Object
show all
Defined in:
lib/chickadee/message_bus.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, &block) ⇒ Subscriber

Returns a new instance of Subscriber.



22
23
24
25
# File 'lib/chickadee/message_bus.rb', line 22

def initialize(id, &block)
  @id = id
  @block = block
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



20
21
22
# File 'lib/chickadee/message_bus.rb', line 20

def id
  @id
end

Instance Method Details

#call(*args) ⇒ Object



27
28
29
# File 'lib/chickadee/message_bus.rb', line 27

def call(*args)
  @block.call(*args)
end