Skip to content

Instantly share code, notes, and snippets.

@brandon-beacher
Created February 17, 2011 23:25
Show Gist options
  • Save brandon-beacher/832965 to your computer and use it in GitHub Desktop.
Save brandon-beacher/832965 to your computer and use it in GitHub Desktop.
require 'xml/mapping/base'
class RawXmlNode < XML::Mapping::SingleAttributeNode
def extract_attr_value(xml)
raw_xml = ''
xml.write(raw_xml)
raw_xml
end
def set_attr_value(xml, value)
raise 'Brandon sez you cannot set a raw xml node for now'
end
end
XML::Mapping.add_node_class RawXmlNode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment