Class: LinkedIn::Message
- Inherits:
-
Object
- Object
- LinkedIn::Message
- Defined in:
- lib/linked_in/message.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#recipients ⇒ Object
Returns the value of attribute recipients.
-
#subject ⇒ Object
Returns the value of attribute subject.
Instance Method Summary collapse
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
4 5 6 |
# File 'lib/linked_in/message.rb', line 4 def body @body end |
#recipients ⇒ Object
Returns the value of attribute recipients.
4 5 6 |
# File 'lib/linked_in/message.rb', line 4 def recipients @recipients end |
#subject ⇒ Object
Returns the value of attribute subject.
4 5 6 |
# File 'lib/linked_in/message.rb', line 4 def subject @subject end |
Instance Method Details
#to_xml ⇒ Object
6 7 8 |
# File 'lib/linked_in/message.rb', line 6 def to_xml self.to_xml_node(Nokogiri.XML('<root/>', nil, 'UTF-8')).to_xml end |
#to_xml_node(doc) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/linked_in/message.rb', line 10 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 |