Class: Jabber::MUC::HipChat::UserData
- Inherits:
-
Object
- Object
- Jabber::MUC::HipChat::UserData
- Defined in:
- lib/xmpp4r/muc/hipchat/user_data.rb
Class Method Summary collapse
Instance Method Summary collapse
- #attributes ⇒ Object
- #id ⇒ Object
-
#initialize(user) ⇒ UserData
constructor
A new instance of UserData.
- #mention ⇒ Object
- #name ⇒ Object
Constructor Details
#initialize(user) ⇒ UserData
Returns a new instance of UserData.
5 6 7 |
# File 'lib/xmpp4r/muc/hipchat/user_data.rb', line 5 def initialize user @user = user end |
Class Method Details
.get_users_data(stream) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/xmpp4r/muc/hipchat/user_data.rb', line 29 def get_users_data stream @stream ||= stream @roster ||= Roster::Helper.new(stream, false) # TODO: Error handling loop do rosterget = Iq.new_rosterget rosterget.id = "roster_1" @stream.send(rosterget) @roster.wait_for_roster break if @roster.items.any? sleep(2) end @roster.items.map do |_, item| self.new(item) end end |
Instance Method Details
#attributes ⇒ Object
21 22 23 24 25 26 |
# File 'lib/xmpp4r/muc/hipchat/user_data.rb', line 21 def attributes { name: name, mention: mention, } end |
#id ⇒ Object
9 10 11 |
# File 'lib/xmpp4r/muc/hipchat/user_data.rb', line 9 def id @user.jid.node end |
#mention ⇒ Object
17 18 19 |
# File 'lib/xmpp4r/muc/hipchat/user_data.rb', line 17 def mention @user.attributes['mention_name'] end |
#name ⇒ Object
13 14 15 |
# File 'lib/xmpp4r/muc/hipchat/user_data.rb', line 13 def name @user.iname end |