Class: Lotus::Atom::PortableContacts

Inherits:
Object
  • Object
show all
Defined in:
lib/lotus/atom/portable_contacts.rb

Overview

Holds information about the extended contact information in the Feed given in the Portable Contacts specification.

Instance Method Summary collapse

Constructor Details

#initialize(parent) ⇒ PortableContacts

Instantiates a Lotus::PortableContacts object from either a given root that contains all <poco:*> tags as an ratom Person

or a Hash containing the properties.


9
10
11
12
13
14
15
# File 'lib/lotus/atom/portable_contacts.rb', line 9

def initialize(parent)
  if parent.is_a? Hash
    @options = parent
  else
    @parent = parent
  end
end

Instance Method Details

#anniversaryObject



47
# File 'lib/lotus/atom/portable_contacts.rb', line 47

def anniversary; get_date(:anniversary); end

#birthdayObject



46
# File 'lib/lotus/atom/portable_contacts.rb', line 46

def birthday;    get_date(:birthday); end

#connectedObject

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.



52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/lotus/atom/portable_contacts.rb', line 52

def connected
  return @options[:connected] unless @options.nil?
  str = @parent.poco_connected

  if str == "true"
    true
  elsif str == "false"
    false
  else
    nil
  end
end

#display_nameObject



32
# File 'lib/lotus/atom/portable_contacts.rb', line 32

def display_name;         get_prop(:display_name, 'displayName'); end

#display_name=(value) ⇒ Object



33
# File 'lib/lotus/atom/portable_contacts.rb', line 33

def display_name= value;  set_prop(:display_name, value, 'displayName'); end

#genderObject



26
# File 'lib/lotus/atom/portable_contacts.rb', line 26

def gender;               get_prop(:gender); end

#gender=(value) ⇒ Object



27
# File 'lib/lotus/atom/portable_contacts.rb', line 27

def gender= value;        set_prop(:gender, value); end

#idObject



17
# File 'lib/lotus/atom/portable_contacts.rb', line 17

def id;                   get_prop(:id); end

#id=(value) ⇒ Object



18
# File 'lib/lotus/atom/portable_contacts.rb', line 18

def id= value;            set_prop(:id, value); end

#nameObject



20
# File 'lib/lotus/atom/portable_contacts.rb', line 20

def name;                 get_prop(:name); end

#name=(value) ⇒ Object



21
# File 'lib/lotus/atom/portable_contacts.rb', line 21

def name= value;          set_prop(:name, value); end

#nicknameObject



23
# File 'lib/lotus/atom/portable_contacts.rb', line 23

def nickname;             get_prop(:nickname); end

#nickname=(value) ⇒ Object



24
# File 'lib/lotus/atom/portable_contacts.rb', line 24

def nickname= value;      set_prop(:nickname, value); end

#noteObject



29
# File 'lib/lotus/atom/portable_contacts.rb', line 29

def note;                 get_prop(:note); end

#note=(value) ⇒ Object



30
# File 'lib/lotus/atom/portable_contacts.rb', line 30

def note= value;          set_prop(:note, value); end

#preferred_usernameObject



35
36
37
# File 'lib/lotus/atom/portable_contacts.rb', line 35

def preferred_username
  get_prop(:preferred_username, 'preferredUsername')
end

#preferred_username=(value) ⇒ Object



39
40
41
# File 'lib/lotus/atom/portable_contacts.rb', line 39

def preferred_username= value
  set_prop(:preferred_username, value, 'preferredUsername')
end

#publishedObject



44
# File 'lib/lotus/atom/portable_contacts.rb', line 44

def published; get_datetime(:published); end

#updatedObject



43
# File 'lib/lotus/atom/portable_contacts.rb', line 43

def updated;   get_datetime(:updated); end