Created
October 25, 2012 03:55
-
-
Save hartct/3950336 to your computer and use it in GitHub Desktop.
Example of using post_save method with xml-mapping gem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class InstitutionLogin | |
include XML::Mapping | |
# added namespaces to make root element compliant with recipients's expectation | |
def post_save xml, options={:mapping=>:_default} | |
xml.root.add_attributes("xmlns"=>"http://schema.intuit.com/platform/fdatafeed/institutionlogin/v1") | |
xml.root.add_namespace "xsi", "http://www.w3.org/2001/XMLSchema-instance" | |
xml.root.add_namespace "xsd", "http://www.w3.org/2001/XMLSchema" | |
end | |
self.root_element_name "InstitutionLogin" | |
object_node :credentials, "credentials", :default_value => nil | |
object_node :challenge_responses, "challengeResponses", :default_value => nil | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment