Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # f is a field name/value hash that I will use to populate the CSV record
- # d is the top level object returned by the SOAP call
- # Apparently, if a value is optional, and does not exist in the response,
- # a function will not be created for it. That's why I need the respond_to's.
- ok = (d.respond_to?('relevantContractDates') and d.relevantContractDates != nil)
- e = ok ? d.relevantContractDates : nil
- f[:signedDate] = (ok and e.respond_to?('signedDate')) ? e.signedDate : nil
- f[:effectiveDate] = (ok and e.respond_to?('effectiveDate')) ? e.effectiveDate : nil
- f[:currentCompletionDate] = (ok and e.respond_to?('currentCompletionDate')) ? e.currentCompletionDate : nil
- f[:ultimateCompletionDate] = (ok and e.respond_to?('ultimateCompletionDate')) ? e.ultimateCompletionDate : nil
Add Comment
Please, Sign In to add comment