Class: LinkedIn::Person

Inherits:
Object
  • Object
show all
Defined in:
lib/linked_in/person.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#first_nameObject

Returns the value of attribute first_name.



4
5
6
# File 'lib/linked_in/person.rb', line 4

def first_name
  @first_name
end

#last_nameObject

Returns the value of attribute last_name.



4
5
6
# File 'lib/linked_in/person.rb', line 4

def last_name
  @last_name
end

#pathObject

Returns the value of attribute path.



4
5
6
# File 'lib/linked_in/person.rb', line 4

def path
  @path
end

Instance Method Details

#to_xmlObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/linked_in/person.rb', line 6

def to_xml
  str = ''
  
  if first_name != nil || last_name != nil
    str << "<person path=#{path}>"
    if first_name != nil
      str << "<first-name>#{first_name}</first-name>"
    end
    if last_name != nil
      str << "<last-name>#{last_name}</last-name>"
    end
    str << "</person>"
  else
    str << "<person path=#{path}/>"
  end
  
  str
end