class Jabber::MUC::UserItem

Don't use this. It is the base class (unifying shared attributes) of XMUCUserItem and IqQueryMUCAdminItem

Public Instance Methods

actors() click to toggle source
# File lib/xmpp4r/muc/item.rb, line 121
def actors
  a = []
  each_element('actor') { |xe|
    a.push(JID.new(xe.attributes['jid']))
  }
  a
end
actors=(a) click to toggle source
# File lib/xmpp4r/muc/item.rb, line 129
def actors=(a)
  delete_elements('actor')
  a.each { |jid|
    e = add_element('actor')
    e.attributes['jid'] = jid.to_s
  }
end
affiliation() click to toggle source
# File lib/xmpp4r/muc/item.rb, line 11
def affiliation
  case attributes['affiliation']
    when 'admin' then :admin
    when 'member' then :member
    when 'none' then :none
    when 'outcast' then :outcast
    when 'owner' then :owner
    else nil
  end
end
affiliation=(v) click to toggle source
# File lib/xmpp4r/muc/item.rb, line 22
def affiliation=(v)
  case v
    when :admin then attributes['affiliation'] = 'admin'
    when :member then attributes['affiliation'] = 'member'
    when :none then attributes['affiliation'] = 'none'
    when :outcast then attributes['affiliation'] = 'outcast'
    when :owner then attributes['affiliation'] = 'owner'
    else attributes['affiliation'] = nil
  end
end
continue() click to toggle source
# File lib/xmpp4r/muc/item.rb, line 105
def continue
  c = nil
  each_element('continue') { |xe| c = xe }
  c.nil?
end
continue=(c) click to toggle source
# File lib/xmpp4r/muc/item.rb, line 111
def continue=(c)
  delete_elements('continue')
  add_element('continue') if c
end
jid() click to toggle source
# File lib/xmpp4r/muc/item.rb, line 38
def jid
  attributes['jid'].nil? ? nil : JID.new(attributes['jid'])
end
jid=(j) click to toggle source
# File lib/xmpp4r/muc/item.rb, line 42
def jid=(j)
  attributes['jid'] = j.nil? ? nil : j.to_s
end
nick() click to toggle source
# File lib/xmpp4r/muc/item.rb, line 51
def nick
  attributes['nick']
end
nick=(n) click to toggle source
# File lib/xmpp4r/muc/item.rb, line 55
def nick=(n)
  attributes['nick'] = n
end
reason() click to toggle source
# File lib/xmpp4r/muc/item.rb, line 89
def reason
  text = nil
  each_element('reason') { |xe| text = xe.text }
  text
end
reason=(s) click to toggle source
# File lib/xmpp4r/muc/item.rb, line 95
def reason=(s)
  delete_elements('reasion')
  add_element('reason').text = s
end
role() click to toggle source
# File lib/xmpp4r/muc/item.rb, line 64
def role
  case attributes['role']
    when 'moderator' then :moderator
    when 'none' then :none
    when 'participant' then :participant
    when 'visitor' then :visitor
    else nil
  end
end
role=(r) click to toggle source
# File lib/xmpp4r/muc/item.rb, line 74
def role=(r)
  case r
    when :moderator then attributes['role'] = 'moderator'
    when :none then attributes['role'] = 'none'
    when :participant then attributes['role'] = 'participant'
    when :visitor then attributes['role'] = 'visitor'
    else attributes['role'] = nil
  end
end
set_actors(a) click to toggle source
# File lib/xmpp4r/muc/item.rb, line 137
def set_actors(a)
  self.actors = a
  self
end
set_affiliation(v) click to toggle source
# File lib/xmpp4r/muc/item.rb, line 33
def set_affiliation(v)
  self.affiliation = v
  self
end
set_continue(c) click to toggle source
# File lib/xmpp4r/muc/item.rb, line 116
def set_continue(c)
  self.continue = c
  self
end
set_jid(j) click to toggle source
# File lib/xmpp4r/muc/item.rb, line 46
def set_jid(j)
  self.jid = j
  self
end
set_nick(n) click to toggle source
# File lib/xmpp4r/muc/item.rb, line 59
def set_nick(n)
  self.nick = n
  self
end
set_reason(s) click to toggle source
# File lib/xmpp4r/muc/item.rb, line 100
def set_reason(s)
  self.reason = s
  self
end
set_role(r) click to toggle source
# File lib/xmpp4r/muc/item.rb, line 84
def set_role(r)
  self.role = r
  self
end