Class: RSMP::Listener

Inherits:
Object
  • Object
show all
Includes:
Inspect
Defined in:
lib/rsmp/listener.rb

Direct Known Subclasses

Collector

Instance Method Summary collapse

Methods included from Inspect

#inspect, #inspector

Constructor Details

#initialize(proxy, options = {}) ⇒ Listener

Returns a new instance of Listener.


8
9
10
# File 'lib/rsmp/listener.rb', line 8

def initialize proxy, options={}
  @proxy = proxy
end

Instance Method Details

#listen(&block) ⇒ Object


15
16
17
18
19
20
# File 'lib/rsmp/listener.rb', line 15

def listen &block
  @proxy.add_listener self
  yield
ensure
  @proxy.remove_listener self
end

#notify(message) ⇒ Object


12
13
# File 'lib/rsmp/listener.rb', line 12

def notify message
end