Method: Jabber::Roster::Helper#groups

Defined in:
lib/vendor/xmpp4r/lib/xmpp4r/roster/helper/roster.rb

#groupsObject

Groups in this Roster, sorted by name

Contains nil if there are ungrouped items

result
Array

containing group names (String)



280
281
282
283
284
285
286
287
288
289
# File 'lib/vendor/xmpp4r/lib/xmpp4r/roster/helper/roster.rb', line 280

def groups
  res = []
  @items_lock.synchronize {
    @items.each_pair do |jid,item|
      res += item.groups
      res += [nil] if item.groups == []
    end
  }
  res.uniq.sort { |a,b| a.to_s <=> b.to_s }
end