Class: Tester
- Inherits:
-
Object
- Object
- Tester
- Defined in:
- lib/omf-web/xmpp_adapter.rb
Instance Method Summary collapse
-
#initialize(opts) ⇒ Tester
constructor
A new instance of Tester.
- #subscribe(addr = {}, &block) ⇒ Object
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 |