class Jabber::MUC::HipChat::RoomData

Attributes

attributes[RW]

ATTRIBUTES = [:id, :topic, :privacy, :is_archived, :guest_url, :owner, :last_active, :num_participants]

Public Class Methods

get_rooms_data(stream, conference_host) click to toggle source
# File lib/xmpp4r/muc/hipchat/room_data.rb, line 29
def get_rooms_data stream, conference_host
  iq = Iq.new(:get, conference_host)
  iq.from = stream.jid
  iq.add(Discovery::IqQueryDiscoItems.new)

  rooms = []
  stream.send_with_id(iq) do |answer|
    answer.query.each_element('item') do |item|
      rooms << self.new(item)
    end
  end
  rooms
end
new(room) click to toggle source
# File lib/xmpp4r/muc/hipchat/room_data.rb, line 8
def initialize room
  @room       = room
  @attributes = {
    "name" => name,
    "id" => id,
  }

  room.first.children.each do |c|
    @attributes[c.name] ||= c.text
  end
end

Public Instance Methods

id() click to toggle source
# File lib/xmpp4r/muc/hipchat/room_data.rb, line 24
def id
  @room.jid.node
end
name() click to toggle source
# File lib/xmpp4r/muc/hipchat/room_data.rb, line 20
def name
  @room.iname
end