Class | Jabber::MUC::XMUCUserItem |
In: |
lib/xmpp4r/muc/x/mucuseritem.rb
|
Parent: | XMPPElement |
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 10 10: def initialize(affiliation=nil, role=nil, jid=nil) 11: super() 12: set_affiliation(affiliation) 13: set_role(role) 14: set_jid(jid) 15: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 127 127: def actors 128: a = [] 129: each_element('actor') { |xe| 130: a.push(JID::new(xe.attributes['jid'])) 131: } 132: a 133: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 135 135: def actors=(a) 136: delete_elements('actor') 137: a.each { |jid| 138: e = add_element('actor') 139: e.attributes['jid'] = jid.to_s 140: } 141: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 17 17: def affiliation 18: case attributes['affiliation'] 19: when 'admin' then :admin 20: when 'member' then :member 21: when 'none' then :none 22: when 'outcast' then :outcast 23: when 'owner' then :owner 24: else nil 25: end 26: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 28 28: def affiliation=(v) 29: case v 30: when :admin then attributes['affiliation'] = 'admin' 31: when :member then attributes['affiliation'] = 'member' 32: when :none then attributes['affiliation'] = 'none' 33: when :outcast then attributes['affiliation'] = 'outcast' 34: when :owner then attributes['affiliation'] = 'owner' 35: else attributes['affiliation'] = nil 36: end 37: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 111 111: def continue 112: c = nil 113: each_element('continue') { |xe| c = xe } 114: c.nil? 115: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 117 117: def continue=(c) 118: delete_elements('continue') 119: add_element('continue') if c 120: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 44 44: def jid 45: attributes['jid'].nil? ? nil : JID::new(attributes['jid']) 46: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 48 48: def jid=(j) 49: attributes['jid'] = j.nil? ? nil : j.to_s 50: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 95 95: def reason 96: text = nil 97: each_element('reason') { |xe| text = xe.text } 98: text 99: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 101 101: def reason=(s) 102: delete_elements('reasion') 103: add_element('reason').text = s 104: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 70 70: def role 71: case attributes['role'] 72: when 'moderator' then :moderator 73: when 'none' then :none 74: when 'participant' then :participant 75: when 'visitor' then :visitor 76: else nil 77: end 78: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 80 80: def role=(r) 81: case r 82: when :moderator then attributes['role'] = 'moderator' 83: when :none then attributes['role'] = 'none' 84: when :participant then attributes['role'] = 'participant' 85: when :visitor then attributes['role'] = 'visitor' 86: else attributes['role'] = nil 87: end 88: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 143 143: def set_actors(a) 144: self.actors = a 145: self 146: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 39 39: def set_affiliation(v) 40: self.affiliation = v 41: self 42: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 122 122: def set_continue(c) 123: self.continue = c 124: self 125: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 52 52: def set_jid(j) 53: self.jid = j 54: self 55: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 65 65: def set_nick(n) 66: self.nick = n 67: self 68: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 106 106: def set_reason(s) 107: self.reason = s 108: self 109: end