Class: Circus::Agents::Conversation

Inherits:
Object
  • Object
show all
Defined in:
lib/circus/agents/conversation.rb

Constant Summary collapse

CHAT_STATES =
'http://jabber.org/protocol/chatstates'

Class Method Summary collapse

Class Method Details

.end(m) ⇒ Object



6
7
8
9
10
# File 'lib/circus/agents/conversation.rb', line 6

def self.end(m)
  gone_el = Nokogiri::XML::Element.new('gone', m.document)
  gone_el.default_namespace = CHAT_STATES
  m << gone_el
end

.ended?(m) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/circus/agents/conversation.rb', line 12

def self.ended?(m)
  m.xpath('ns:gone', 'ns' => CHAT_STATES).length > 0
end