Class: Tester

Inherits:
Object
  • Object
show all
Defined in:
lib/omf-web/xmpp_adapter.rb

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ Tester

Returns a new instance of Tester.



8
9
10
11
12
13
14
# File 'lib/omf-web/xmpp_adapter.rb', line 8

def initialize(opts)
  @sliceID = opts[:sliceID]
  @domain = opts[:config][:xmpp][:pubsub_gateway]
  @transport = OMFPubSubTransport.instance
  @transport.init(opts)
  @slice_addr = @transport.get_new_address(:sliceID => @sliceID, :domain => @domain) 
end

Instance Method Details

#subscribe(addr = {}, &block) ⇒ Object



16
17
18
19
# File 'lib/omf-web/xmpp_adapter.rb', line 16

def subscribe(addr = {}, &block)
  xaddr = @transport.get_new_address(addr.merge(:sliceID => @sliceID, :domain => @domain))
  @transport.listen(xaddr, &block)
end