Class: LinkedIn::Recipients
- Inherits:
-
Object
- Object
- LinkedIn::Recipients
- Defined in:
- lib/linked_in/recipients.rb
Instance Attribute Summary collapse
-
#recipients ⇒ Object
Returns the value of attribute recipients.
Instance Method Summary collapse
Instance Attribute Details
#recipients ⇒ Object
Returns the value of attribute recipients.
4 5 6 |
# File 'lib/linked_in/recipients.rb', line 4 def recipients @recipients end |
Instance Method Details
#to_xml ⇒ Object
6 7 8 |
# File 'lib/linked_in/recipients.rb', line 6 def to_xml self.to_xml_nodes(Nokogiri.XML('<root/>', nil, 'UTF-8')).to_xml end |
#to_xml_nodes(doc) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/linked_in/recipients.rb', line 10 def to_xml_nodes(doc) recipients.inject(Nokogiri::XML::NodeSet.new(doc)) do |nodes, recipient| node = Nokogiri::XML::DocumentFragment.new(doc, '<recipient><person/></recipient>') node.at_css('person')['path'] = recipient.person.path nodes << node end end |