Class: OmfCommon::Comm::XMPP::Topic

Inherits:
Topic
  • Object
show all
Defined in:
lib/omf_common/comm/xmpp/topic.rb

Instance Attribute Summary

Attributes inherited from Topic

#id

Instance Method Summary collapse

Methods inherited from Topic

[], #after, #configure, create, #create, #create_message_and_publish, #error?, #inform, #on_inform, #on_message, #publish, #release, #request

Instance Method Details

#addressObject

end



16
17
18
19
# File 'lib/omf_common/comm/xmpp/topic.rb', line 16

def address
  #"xmpp://#{id.to_s}@#{OmfCommon.comm.jid.domain}"
  "xmpp://#{id.to_s}@#{@pubsub_domain}"
end

#on_subscribed(&block) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/omf_common/comm/xmpp/topic.rb', line 21

def on_subscribed(&block)
  return unless block

  @lock.synchronize do
    @on_subscrided_handlers << block
  end
end

#unsubscribe(key) ⇒ Object



29
30
31
32
# File 'lib/omf_common/comm/xmpp/topic.rb', line 29

def unsubscribe(key)
  super
  OmfCommon.comm._unsubscribe_one(self.id)
end