Sha256: a2874b4bd7d6ee671ae728d75114feda7eb5ea119b306e9f4a9f2f8ef0ac5069
Contents?: true
Size: 1.09 KB
Versions: 17
Compression:
Stored size: 1.09 KB
Contents
# License: see LICENSE.txt # Jabber4R - Jabber Instant Messaging Library for Ruby # Copyright (C) 2002 Rich Kilmer <rich@infoether.com> # module Jabber ## # The VCard class holds the parsed VCard data from the Jabber service. # class VCard attr_accessor :given, :family, :middle, :nickname, :email ## # Factory to create the VCard from the ParsedXMLElement # # je:: [ParsedXMLElement] The VCard as an xml element. # return:: [Jabber::VCard] The newly created VCard. # def VCard.from_element(je) card = VCard.new return card unless je card.given = je.N.GIVEN.element_data card.family = je.N.FAMILY.element_data card.middle = je.N.MIDDLE.element_data card.email = je.EMAIL.element_data card.nickname = je.NICKNAME.element_data return card end ## # Dumps the attributes of the VCard # # return:: [String] The VCard as a string. # def to_s "VCARD: [first=#{@given} last=#{@family} nick=#{@nickname} email=#{@email}]" end end end
Version data entries
17 entries across 17 versions & 3 rubygems