Class: Jabber::MUC::XMUCUserInvite

Inherits:
REXML::Element show all
Defined in:
lib/xmpp4r/muc/x/mucuserinvite.rb

Instance Method Summary collapse

Methods inherited from REXML::Element

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

Constructor Details

#initialize(to = nil, reason = nil) ⇒ XMUCUserInvite

Returns a new instance of XMUCUserInvite



8
9
10
11
12
# File 'lib/xmpp4r/muc/x/mucuserinvite.rb', line 8

def initialize(to=nil, reason=nil)
  super('invite')
  set_to(to)
  set_reason(reason)
end

Instance Method Details

#fromObject



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

def from
  attributes['from'].nil? ? nil : JID::new(attributes['from'])
end

#from=(j) ⇒ Object



31
32
33
# File 'lib/xmpp4r/muc/x/mucuserinvite.rb', line 31

def from=(j)
  attributes['from'] = (j.nil? ? nil : j.to_s)
end

#reasonObject



40
41
42
# File 'lib/xmpp4r/muc/x/mucuserinvite.rb', line 40

def reason
  first_element_text('reason')
end

#reason=(s) ⇒ Object



44
45
46
47
48
49
50
# File 'lib/xmpp4r/muc/x/mucuserinvite.rb', line 44

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

#set_from(j) ⇒ Object



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

def set_from(j)
  self.from = j
  self
end

#set_reason(s) ⇒ Object



52
53
54
55
# File 'lib/xmpp4r/muc/x/mucuserinvite.rb', line 52

def set_reason(s)
  self.reason = s
  self
end

#set_to(j) ⇒ Object



22
23
24
25
# File 'lib/xmpp4r/muc/x/mucuserinvite.rb', line 22

def set_to(j)
  self.to = j
  self
end

#toObject



14
15
16
# File 'lib/xmpp4r/muc/x/mucuserinvite.rb', line 14

def to
  attributes['to'].nil? ? nil : JID::new(attributes['to'])
end

#to=(j) ⇒ Object



18
19
20
# File 'lib/xmpp4r/muc/x/mucuserinvite.rb', line 18

def to=(j)
  attributes['to'] = j.nil? ? nil : j.to_s
end