Method: Frodo::Entity#to_xml
- Defined in:
- lib/frodo/entity.rb
#to_xml ⇒ String
Converts Entity to its XML representation.
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 |
# File 'lib/frodo/entity.rb', line 177 def to_xml namespaces = XML_NAMESPACES.merge('xml:base' => service.service_url) builder = Nokogiri::XML::Builder.new do |xml| xml.entry(namespaces) do xml.category(term: type, scheme: 'http://docs.oasis-open.org/odata/ns/scheme') xml. { xml.name } xml.content(type: 'application/xml') do xml['metadata'].properties do property_names.each do |name| next if name == primary_key get_property(name).to_xml(xml) end end end end end builder.to_xml end |