Sha256: d48e03472a41f75083da8c203444ea7b583f115f705687b053ddf43632a948d0

Contents?: true

Size: 524 Bytes

Versions: 7

Compression:

Stored size: 524 Bytes

Contents

module LinkedIn
  class Message

    attr_accessor :subject, :body, :recipients
  
    def to_xml
      self.to_xml_node(Nokogiri.XML('<root/>', nil, 'UTF-8')).to_xml
    end

    def to_xml_node(doc)
      node = Nokogiri::XML::DocumentFragment.new(doc, '<mailbox-item><recipients/><subject/><body/></mailbox-item>')
      node.at_css('recipients').add_child(self.recipients.to_xml_nodes(doc))
      node.at_css('subject').content = self.subject
      node.at_css('body').content = self.body
      node
    end

  end

end

Version data entries

7 entries across 7 versions & 3 rubygems

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