Class: OStatus::PortableContacts
- Inherits:
-
Object
- Object
- OStatus::PortableContacts
- Defined in:
- lib/ostatus/portable_contacts.rb
Overview
Holds information about the extended contact information in the Feed given in the Portable Contacts specification.
Instance Method Summary collapse
- #anniversary ⇒ Object
- #birthday ⇒ Object
-
#connected ⇒ Object
Returns a boolean that indicates that a bi-directional connection has been established between the user and the contact, if it is able to assert this.
- #display_name ⇒ Object
- #display_name=(value) ⇒ Object
- #gender ⇒ Object
- #gender=(value) ⇒ Object
- #id ⇒ Object
- #id=(value) ⇒ Object
-
#initialize(parent) ⇒ PortableContacts
constructor
Instantiates a OStatus::PortableContacts object from either a given root that contains all <poco:*> tags as an ratom Person or a Hash containing the properties.
- #name ⇒ Object
- #name=(value) ⇒ Object
- #nickname ⇒ Object
- #nickname=(value) ⇒ Object
- #note ⇒ Object
- #note=(value) ⇒ Object
- #preferred_username ⇒ Object
- #preferred_username=(value) ⇒ Object
- #published ⇒ Object
- #updated ⇒ Object
Constructor Details
#initialize(parent) ⇒ PortableContacts
Instantiates a OStatus::PortableContacts object from either a given root that contains all <poco:*> tags as an ratom Person
or a Hash containing the properties.
11 12 13 14 15 16 17 |
# File 'lib/ostatus/portable_contacts.rb', line 11 def initialize(parent) if parent.is_a? Hash = parent else @parent = parent end end |
Instance Method Details
#anniversary ⇒ Object
49 |
# File 'lib/ostatus/portable_contacts.rb', line 49 def anniversary; get_date(:anniversary); end |
#birthday ⇒ Object
48 |
# File 'lib/ostatus/portable_contacts.rb', line 48 def birthday; get_date(:birthday); end |
#connected ⇒ Object
Returns a boolean that indicates that a bi-directional connection has been established between the user and the contact, if it is able to assert this.
54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/ostatus/portable_contacts.rb', line 54 def connected return [:connected] unless .nil? str = @parent.poco_connected if str == "true" true elsif str == "false" false else nil end end |
#display_name ⇒ Object
34 |
# File 'lib/ostatus/portable_contacts.rb', line 34 def display_name; get_prop(:display_name, 'displayName'); end |
#display_name=(value) ⇒ Object
35 |
# File 'lib/ostatus/portable_contacts.rb', line 35 def display_name= value; set_prop(:display_name, value, 'displayName'); end |
#gender ⇒ Object
28 |
# File 'lib/ostatus/portable_contacts.rb', line 28 def gender; get_prop(:gender); end |
#gender=(value) ⇒ Object
29 |
# File 'lib/ostatus/portable_contacts.rb', line 29 def gender= value; set_prop(:gender, value); end |
#id ⇒ Object
19 |
# File 'lib/ostatus/portable_contacts.rb', line 19 def id; get_prop(:id); end |
#id=(value) ⇒ Object
20 |
# File 'lib/ostatus/portable_contacts.rb', line 20 def id= value; set_prop(:id, value); end |
#name ⇒ Object
22 |
# File 'lib/ostatus/portable_contacts.rb', line 22 def name; get_prop(:name); end |
#name=(value) ⇒ Object
23 |
# File 'lib/ostatus/portable_contacts.rb', line 23 def name= value; set_prop(:name, value); end |
#nickname ⇒ Object
25 |
# File 'lib/ostatus/portable_contacts.rb', line 25 def nickname; get_prop(:nickname); end |
#nickname=(value) ⇒ Object
26 |
# File 'lib/ostatus/portable_contacts.rb', line 26 def nickname= value; set_prop(:nickname, value); end |
#note ⇒ Object
31 |
# File 'lib/ostatus/portable_contacts.rb', line 31 def note; get_prop(:note); end |
#note=(value) ⇒ Object
32 |
# File 'lib/ostatus/portable_contacts.rb', line 32 def note= value; set_prop(:note, value); end |
#preferred_username ⇒ Object
37 38 39 |
# File 'lib/ostatus/portable_contacts.rb', line 37 def preferred_username get_prop(:preferred_username, 'preferredUsername') end |
#preferred_username=(value) ⇒ Object
41 42 43 |
# File 'lib/ostatus/portable_contacts.rb', line 41 def preferred_username= value set_prop(:preferred_username, value, 'preferredUsername') end |
#published ⇒ Object
46 |
# File 'lib/ostatus/portable_contacts.rb', line 46 def published; get_datetime(:published); end |
#updated ⇒ Object
45 |
# File 'lib/ostatus/portable_contacts.rb', line 45 def updated; get_datetime(:updated); end |