lib/intacctrb/employee.rb in intacctrb-0.7 vs lib/intacctrb/employee.rb in intacctrb-0.7.1

- old
+ new

@@ -30,14 +30,14 @@ } end if successful? data = OpenStruct.new({ - id: response.at("//EMPLOYEE/RECORDNO").content, - name: response.at("//EMPLOYEE/PERSONALINFO/CONTACTNAME").content, - contact_id: response.at("//EMPLOYEE/CONTACTKEY").content, - employee_id: response.at("//EMPLOYEE/EMPLOYEEID").content + id: response.at("//EMPLOYEE/RECORDNO").try(:content), + name: response.at("//EMPLOYEE/PERSONALINFO/CONTACTNAME").try(:content), + contact_id: response.at("//EMPLOYEE/CONTACTKEY").try(:content), + employee_id: response.at("//EMPLOYEE/EMPLOYEEID").try(:content) }) end return_result(response, data) end @@ -60,13 +60,13 @@ } end if successful? data = OpenStruct.new({ - id: response.at("//EMPLOYEE/RECORDNO").content, - name: response.at("//EMPLOYEE/PERSONALINFO/CONTACTNAME").content, - contact_id: response.at("//EMPLOYEE/CONTACTKEY").content, - employee_id: response.at("//EMPLOYEE/EMPLOYEEID").content + id: response.at("//EMPLOYEE/RECORDNO").try(:content), + name: response.at("//EMPLOYEE/PERSONALINFO/CONTACTNAME").try(:content), + contact_id: response.at("//EMPLOYEE/CONTACTKEY").try(:content), + employee_id: response.at("//EMPLOYEE/EMPLOYEEID").try(:content) }) end return_result(response, data) end