Class: Exchanger::Body
- Defined in:
- lib/exchanger/elements/body.rb
Overview
The Body element represents the body of an item.
Body: msdn.microsoft.com/en-us/library/office/jj219983(v=exchg.150).aspx BodyType: msdn.microsoft.com/en-us/library/office/aa565622(v=exchg.150).aspx
Instance Attribute Summary
Attributes inherited from Element
Instance Method Summary collapse
Methods inherited from Element
#==, #assign_attributes_from_xml, create_element_accessors, element, #errors, #initialize, #inspect, key, new_from_xml, #to_xml_change, #to_xml_updates
Methods included from Persistence
#destroy, #new_record?, #persisted?, #reload, #save
Methods included from Dirty
#attribute_change, #attribute_changed?, #attribute_was, #changed, #changed?, #changes, included, #move_changes, #previous_changes, #reset_attribute!, #reset_modifications, #setup_modifications
Methods included from Attributes
#attributes, #attributes=, #change_key, #id, #identifier, #method_missing, #read_attribute, #respond_to?, #write_attribute
Constructor Details
This class inherits a constructor from Exchanger::Element
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Exchanger::Attributes
Instance Method Details
#to_xml(options = {}) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/exchanger/elements/body.rb', line 12 def to_xml( = {}) doc = Nokogiri::XML::Document.new body_attributes = { "BodyType" => body_type || "Text" } body_attributes["IsTruncated"] = is_truncated if is_truncated root = doc.create_element(tag_name, body_attributes) root << doc.create_text_node(text.to_s) root end |