Class: Jabber::VCard
- Inherits:
-
Object
- Object
- Jabber::VCard
- Defined in:
- lib/jabber4r/vcard.rb
Overview
The VCard class holds the parsed VCard data from the Jabber service.
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#family ⇒ Object
Returns the value of attribute family.
-
#given ⇒ Object
Returns the value of attribute given.
-
#middle ⇒ Object
Returns the value of attribute middle.
-
#nickname ⇒ Object
Returns the value of attribute nickname.
Class Method Summary collapse
-
.from_element(je) ⇒ Object
Factory to create the VCard from the ParsedXMLElement.
Instance Method Summary collapse
-
#to_s ⇒ Object
Dumps the attributes of the VCard.
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email.
13 14 15 |
# File 'lib/jabber4r/vcard.rb', line 13 def email @email end |
#family ⇒ Object
Returns the value of attribute family.
13 14 15 |
# File 'lib/jabber4r/vcard.rb', line 13 def family @family end |
#given ⇒ Object
Returns the value of attribute given.
13 14 15 |
# File 'lib/jabber4r/vcard.rb', line 13 def given @given end |
#middle ⇒ Object
Returns the value of attribute middle.
13 14 15 |
# File 'lib/jabber4r/vcard.rb', line 13 def middle @middle end |
#nickname ⇒ Object
Returns the value of attribute nickname.
13 14 15 |
# File 'lib/jabber4r/vcard.rb', line 13 def nickname @nickname end |
Class Method Details
.from_element(je) ⇒ Object
Factory to create the VCard from the ParsedXMLElement
- je
- ParsedXMLElement
-
The VCard as an xml element.
- return
- Jabber::VCard
-
The newly created VCard.
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/jabber4r/vcard.rb', line 21 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 |
Instance Method Details
#to_s ⇒ Object
Dumps the attributes of the VCard
- return
- String
-
The VCard as a string. #
36 37 38 |
# File 'lib/jabber4r/vcard.rb', line 36 def to_s "VCARD: [first=#{@given} last=#{@family} nick=#{@nickname} email=#{@email}]" end |