Sha256: e887a434ec35eb18fde4aad7fa0a30188ce273c01686f8058437fdad33391793

Contents?: true

Size: 474 Bytes

Versions: 7

Compression:

Stored size: 474 Bytes

Contents

module LinkedIn
  class Recipients

    attr_accessor :recipients

    def to_xml
      self.to_xml_nodes(Nokogiri.XML('<root/>', nil, 'UTF-8')).to_xml
    end
    
    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
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
linkedin-bdigital-0.2.2.3 lib/linked_in/recipients.rb
cl_linkedin-0.2.3 lib/linked_in/recipients.rb
linkedin-bdigital-0.2.2.2 lib/linked_in/recipients.rb
linkedin-bdigital-0.2.2.1 lib/linked_in/recipients.rb
linkedin-bdigital-0.2.2 lib/linked_in/recipients.rb
linkedin-0.2.2 lib/linked_in/recipients.rb
linkedin-0.2.1 lib/linked_in/recipients.rb