Class Jabber::XMucUserItem
In: lib/xmpp4r/x/mucuseritem.rb
Parent: REXML::Element
X XDelay XMuc XRoster XMucUser REXML::Element XRosterItem IqQuery XMLStanza IqVcard DiscoIdentity XMucUserItem DiscoItem Error RosterItem DiscoFeature IqQueryRoster IqQueryVersion IqQueryDiscoItems IqQueryDiscoInfo Message Presence Iq Singleton IdGenerator Connection Client Component Comparable JID RuntimeError ErrorException AuthenticationFailure RosterItem Stream StreamParser Roster Vcard Version lib/xmpp4r/authenticationfailure.rb lib/xmpp4r/iq/query/roster.rb lib/xmpp4r/idgenerator.rb lib/xmpp4r/iq/query/version.rb lib/xmpp4r/connection.rb lib/xmpp4r/x/mucuseritem.rb lib/xmpp4r/x/roster.rb lib/xmpp4r/iq.rb lib/xmpp4r/jid.rb lib/xmpp4r/iq/query.rb lib/xmpp4r/xmlstanza.rb lib/xmpp4r/x/delay.rb lib/xmpp4r/errorexception.rb lib/xmpp4r/client.rb lib/xmpp4r/stream.rb lib/xmpp4r/x/muc.rb lib/xmpp4r/streamparser.rb lib/xmpp4r/x.rb lib/xmpp4r/iq/vcard.rb lib/xmpp4r/iq/query/discoinfo.rb lib/xmpp4r/error.rb lib/xmpp4r/component.rb lib/xmpp4r/message.rb lib/xmpp4r/iq/query/discoitems.rb lib/xmpp4r/presence.rb lib/xmpp4r/helpers/roster.rb lib/xmpp4r/helpers/vcard.rb lib/xmpp4r/helpers/version.rb Helpers Jabber Module: Jabber

Methods

actors   actors=   affiliation   affiliation=   continue   continue=   jid   jid=   new   nick   nick=   reason   reason=   role   role=   set_actors   set_affiliation   set_continue   set_jid   set_nick   set_reason   set_role  

Public Class methods

[Source]

    # File lib/xmpp4r/x/mucuseritem.rb, line 9
 9:     def initialize(affiliation=nil, role=nil, jid=nil)
10:       super('item')
11:       set_affiliation(affiliation)
12:       set_role(role)
13:       set_jid(jid)
14:     end

Public Instance methods

[Source]

     # File lib/xmpp4r/x/mucuseritem.rb, line 126
126:     def actors
127:       a = []
128:       each_element('actor') { |xe|
129:         a.push(JID::new(xe.attributes['jid']))
130:       }
131:       a
132:     end

[Source]

     # File lib/xmpp4r/x/mucuseritem.rb, line 134
134:     def actors=(a)
135:       delete_elements('actor')
136:       a.each { |jid|
137:         e = add_element('actor')
138:         e.attributes['jid'] = jid.to_s
139:       }
140:     end

[Source]

    # File lib/xmpp4r/x/mucuseritem.rb, line 16
16:     def affiliation
17:       case attributes['affiliation']
18:         when 'admin' then :admin
19:         when 'member' then :member
20:         when 'none' then :none
21:         when 'outcast' then :outcast
22:         when 'owner' then :owner
23:         else nil
24:       end
25:     end

[Source]

    # File lib/xmpp4r/x/mucuseritem.rb, line 27
27:     def affiliation=(v)
28:       case v
29:         when :admin then attributes['affiliation'] = 'admin'
30:         when :member then attributes['affiliation'] = 'member'
31:         when :none then attributes['affiliation'] = 'none'
32:         when :outcast then attributes['affiliation'] = 'outcast'
33:         when :owner then attributes['affiliation'] = 'owner'
34:         else attributes['affiliation'] = nil
35:       end
36:     end

[Source]

     # File lib/xmpp4r/x/mucuseritem.rb, line 110
110:     def continue
111:       c = nil
112:       each_element('continue') { |xe| c = xe }
113:       c.nil?
114:     end

[Source]

     # File lib/xmpp4r/x/mucuseritem.rb, line 116
116:     def continue=(c)
117:       delete_elements('continue')
118:       add_element('continue') if c
119:     end

[Source]

    # File lib/xmpp4r/x/mucuseritem.rb, line 43
43:     def jid
44:       attributes['jid'].nil ? nil : JID::new(attributes['jid'])
45:     end

[Source]

    # File lib/xmpp4r/x/mucuseritem.rb, line 47
47:     def jid=(j)
48:       attributes['jid'] = j.nil? ? nil : j.to_s
49:     end

[Source]

    # File lib/xmpp4r/x/mucuseritem.rb, line 56
56:     def nick
57:       attributes['nick']
58:     end

[Source]

    # File lib/xmpp4r/x/mucuseritem.rb, line 60
60:     def nick=(n)
61:       attributes['nick'] = n
62:     end

[Source]

    # File lib/xmpp4r/x/mucuseritem.rb, line 94
94:     def reason
95:       text = nil
96:       each_element('reason') { |xe| text = xe.text }
97:       text
98:     end

[Source]

     # File lib/xmpp4r/x/mucuseritem.rb, line 100
100:     def reason=(s)
101:       delete_elements('reasion')
102:       add_element('reason').text = s
103:     end

[Source]

    # File lib/xmpp4r/x/mucuseritem.rb, line 69
69:     def role
70:       case attributes['role']
71:         when 'moderator' then :moderator
72:         when 'none' then :none
73:         when 'participant' then :participant
74:         when 'visitor' then :visitor
75:         else nil
76:       end
77:     end

[Source]

    # File lib/xmpp4r/x/mucuseritem.rb, line 79
79:     def role=(r)
80:       case r
81:         when :moderator then attributes['role'] = 'moderator'
82:         when :none then attributes['role'] = 'none'
83:         when :participant then attributes['role'] = 'participant'
84:         when :visitor then attributes['role'] = 'visitor'
85:         else attributes['role'] = nil
86:       end
87:     end

[Source]

     # File lib/xmpp4r/x/mucuseritem.rb, line 142
142:     def set_actors(a)
143:       self.actors = a
144:       self
145:     end

[Source]

    # File lib/xmpp4r/x/mucuseritem.rb, line 38
38:     def set_affiliation(v)
39:       self.affiliation = v
40:       self
41:     end

[Source]

     # File lib/xmpp4r/x/mucuseritem.rb, line 121
121:     def set_continue(c)
122:       self.continue = c
123:       self
124:     end

[Source]

    # File lib/xmpp4r/x/mucuseritem.rb, line 51
51:     def set_jid(j)
52:       self.jid = j
53:       self
54:     end

[Source]

    # File lib/xmpp4r/x/mucuseritem.rb, line 64
64:     def set_nick(n)
65:       self.nick = n
66:       self
67:     end

[Source]

     # File lib/xmpp4r/x/mucuseritem.rb, line 105
105:     def set_reason(s)
106:       self.reason = s
107:       self
108:     end

[Source]

    # File lib/xmpp4r/x/mucuseritem.rb, line 89
89:     def set_role(r)
90:       self.role = r
91:       self
92:     end

[Validate]