Class: Jabber::MUC::HipChat::VCard

Inherits:
Object
  • Object
show all
Defined in:
lib/xmpp4r/muc/hipchat/vcard.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(vcard) ⇒ VCard

Returns a new instance of VCard.



5
6
7
# File 'lib/xmpp4r/muc/hipchat/vcard.rb', line 5

def initialize vcard
  @vcard = vcard
end

Class Method Details

.get_details(stream, user_id) ⇒ Object



30
31
32
33
34
35
# File 'lib/xmpp4r/muc/hipchat/vcard.rb', line 30

def get_details stream, user_id
  @vcard_helper ||= Vcard::Helper.new(stream)
  user_jid        = JID.new(user_id, stream.host)
  vcard           = @vcard_helper.get(user_jid)
  VCard.new(vcard)
end

Instance Method Details

#attributesObject



21
22
23
24
25
26
27
# File 'lib/xmpp4r/muc/hipchat/vcard.rb', line 21

def attributes
  {
    email: email,
    title: title,
    photo: photo,
  }
end

#emailObject



9
10
11
# File 'lib/xmpp4r/muc/hipchat/vcard.rb', line 9

def email
  @vcard['EMAIL/USERID']
end

#photoObject



17
18
19
# File 'lib/xmpp4r/muc/hipchat/vcard.rb', line 17

def photo
  @vcard['PHOTO']
end

#titleObject



13
14
15
# File 'lib/xmpp4r/muc/hipchat/vcard.rb', line 13

def title
  @vcard['TITLE']
end