lib/kashflow_api/models/supplier.rb in kashflow_api-0.0.2 vs lib/kashflow_api/models/supplier.rb in kashflow_api-0.0.3
- old
+ new
@@ -4,21 +4,21 @@
self.find_by_supplier_code(search)
end
def self.find_by_supplier_code(search)
result = KashflowApi.api.get_supplier(search)
- self.build_from_soap(result.basic_hash["soap:Envelope"]["soap:Body"]["GetSupplierResponse"]["GetSupplierResult"])
+ self.build_from_soap(result.hash[:envelope][:body][:get_supplier_response][:get_supplier_result])
end
def self.find_by_supplier_id(search)
result = KashflowApi.api.get_supplier_by_id(search)
- self.build_from_soap(result.basic_hash["soap:Envelope"]["soap:Body"]["GetSupplierByIDResponse"]["GetSupplierByIDResult"])
+ self.build_from_soap(result.hash[:envelope][:body][:get_supplier_by_id_response][:get_supplier_by_id_result])
end
def self.all
result = KashflowApi.api.get_suppliers
suppliers = []
- result.basic_hash["soap:Envelope"]["soap:Body"]["GetSuppliersResponse"]["GetSuppliersResult"]["Supplier"].each do |supplier|
+ result.hash[:envelope][:body][:get_suppliers_response][:get_suppliers_result][:supplier].each do |supplier|
suppliers.push self.build_from_soap supplier
end
suppliers.sort { |x, y| x.name <=> y.name }
end
\ No newline at end of file