Module: Blather::Stanza::Presence::MUCUser::InstanceMethods

Included in:
Blather::Stanza::Presence::MUCUser
Defined in:
lib/blather/stanza/presence/muc_user.rb

Instance Method Summary collapse

Instance Method Details

#affiliationObject



18
19
20
# File 'lib/blather/stanza/presence/muc_user.rb', line 18

def affiliation
  item.affiliation
end

#affiliation=(val) ⇒ Object



22
23
24
# File 'lib/blather/stanza/presence/muc_user.rb', line 22

def affiliation=(val)
  item.affiliation = val
end

#itemObject



53
54
55
56
57
58
59
60
# File 'lib/blather/stanza/presence/muc_user.rb', line 53

def item
  if item = muc_user.find_first('ns:item', :ns => MUCUser.registered_ns)
    Item.new item
  else
    muc_user << (item = Item.new nil, nil, nil, self.document)
    item
  end
end

#jidObject



34
35
36
# File 'lib/blather/stanza/presence/muc_user.rb', line 34

def jid
  item.jid
end

#jid=(val) ⇒ Object



38
39
40
# File 'lib/blather/stanza/presence/muc_user.rb', line 38

def jid=(val)
  item.jid = val
end

#roleObject



26
27
28
# File 'lib/blather/stanza/presence/muc_user.rb', line 26

def role
  item.role
end

#role=(val) ⇒ Object



30
31
32
# File 'lib/blather/stanza/presence/muc_user.rb', line 30

def role=(val)
  item.role = val
end

#statusObject



62
63
64
65
66
# File 'lib/blather/stanza/presence/muc_user.rb', line 62

def status
  muc_user.find('ns:status', :ns => MUCUser.registered_ns).map do |status|
    Status.new status
  end
end

#status_codesObject



42
43
44
# File 'lib/blather/stanza/presence/muc_user.rb', line 42

def status_codes
  status.map &:code
end

#status_codes=(val) ⇒ Object



46
47
48
49
50
51
# File 'lib/blather/stanza/presence/muc_user.rb', line 46

def status_codes=(val)
  muc_user.remove_children :status
  val.each do |code|
    muc_user << Status.new(code)
  end
end