Class: Jabber::MUC::XMUC

Inherits:
X show all
Defined in:
lib/xmpp4r/muc/x/muc.rb

Overview

Class for <x/> elements with namespace jabber.org/protocol/muc

See JEP-0045 for details

Instance Method Summary collapse

Methods inherited from X

add_namespaceclass, import

Methods inherited from REXML::Element

#delete_elements, #first_element, #first_element_text, import, #import, #replace_element_text, #typed_add

Constructor Details

#initializeXMUC

Initialize an <x/> element and set namespace to jabber.org/protocol/muc


19
20
21
22
# File 'lib/xmpp4r/muc/x/muc.rb', line 19

def initialize
  super
  add_namespace('http://jabber.org/protocol/muc')
end

Instance Method Details

#passwordObject

Text content of the <password/> element


26
27
28
# File 'lib/xmpp4r/muc/x/muc.rb', line 26

def password
  first_element_text('password')
end

#password=(s) ⇒ Object

Set the password for joining a room (text content of the <password/> element)


33
34
35
36
37
38
39
# File 'lib/xmpp4r/muc/x/muc.rb', line 33

def password=(s)
  if s
    replace_element_text('password', s)
  else
    delete_elements('password')
  end
end