Class | Jabber::MUC::XMUCUserItem |
In: |
lib/xmpp4r/muc/x/mucuseritem.rb
|
Parent: | REXML::Element |
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 8 8: def initialize(affiliation=nil, role=nil, jid=nil) 9: super('item') 10: set_affiliation(affiliation) 11: set_role(role) 12: set_jid(jid) 13: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 125 125: def actors 126: a = [] 127: each_element('actor') { |xe| 128: a.push(JID::new(xe.attributes['jid'])) 129: } 130: a 131: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 133 133: def actors=(a) 134: delete_elements('actor') 135: a.each { |jid| 136: e = add_element('actor') 137: e.attributes['jid'] = jid.to_s 138: } 139: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 15 15: def affiliation 16: case attributes['affiliation'] 17: when 'admin' then :admin 18: when 'member' then :member 19: when 'none' then :none 20: when 'outcast' then :outcast 21: when 'owner' then :owner 22: else nil 23: end 24: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 26 26: def affiliation=(v) 27: case v 28: when :admin then attributes['affiliation'] = 'admin' 29: when :member then attributes['affiliation'] = 'member' 30: when :none then attributes['affiliation'] = 'none' 31: when :outcast then attributes['affiliation'] = 'outcast' 32: when :owner then attributes['affiliation'] = 'owner' 33: else attributes['affiliation'] = nil 34: end 35: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 109 109: def continue 110: c = nil 111: each_element('continue') { |xe| c = xe } 112: c.nil? 113: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 115 115: def continue=(c) 116: delete_elements('continue') 117: add_element('continue') if c 118: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 42 42: def jid 43: attributes['jid'].nil? ? nil : JID::new(attributes['jid']) 44: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 46 46: def jid=(j) 47: attributes['jid'] = j.nil? ? nil : j.to_s 48: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 93 93: def reason 94: text = nil 95: each_element('reason') { |xe| text = xe.text } 96: text 97: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 99 99: def reason=(s) 100: delete_elements('reasion') 101: add_element('reason').text = s 102: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 68 68: def role 69: case attributes['role'] 70: when 'moderator' then :moderator 71: when 'none' then :none 72: when 'participant' then :participant 73: when 'visitor' then :visitor 74: else nil 75: end 76: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 78 78: def role=(r) 79: case r 80: when :moderator then attributes['role'] = 'moderator' 81: when :none then attributes['role'] = 'none' 82: when :participant then attributes['role'] = 'participant' 83: when :visitor then attributes['role'] = 'visitor' 84: else attributes['role'] = nil 85: end 86: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 141 141: def set_actors(a) 142: self.actors = a 143: self 144: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 37 37: def set_affiliation(v) 38: self.affiliation = v 39: self 40: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 120 120: def set_continue(c) 121: self.continue = c 122: self 123: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 50 50: def set_jid(j) 51: self.jid = j 52: self 53: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 63 63: def set_nick(n) 64: self.nick = n 65: self 66: end
# File lib/xmpp4r/muc/x/mucuseritem.rb, line 104 104: def set_reason(s) 105: self.reason = s 106: self 107: end