Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

formatting API responses

  • Loading branch information...
commit b7e62b08f3e5a7ee721a6c7381f13829d4dbbaa9 1 parent 4324091
@jzw jzw authored
View
4 lib/powa_api/order_service.rb
@@ -21,6 +21,8 @@ def self.find_updated_orders(updated_from, updated_to = nil)
end
end
+ [response.to_array(:find_updated_orders_response).first[:orders]].flatten.compact
+
end
def self.get_order_details(order_number)
@@ -42,6 +44,8 @@ def self.get_order_details(order_number)
end
end
+ response.to_array(:get_order_details_response).first
+
end
private
View
2  lib/powa_api/powa_service.rb
@@ -21,6 +21,8 @@ def self.get_publish_info
end
end
end
+
+ response.to_array(:get_publish_info_response).first
end
protected
View
9 lib/powa_api/product_service.rb
@@ -19,6 +19,8 @@ def self.get_published_products(publish_token, batch_number = nil)
end
end
end
+
+ [response.to_array(:get_published_products_response).first[:products]].flatten.compact
end
def self.get_published_products_by_sku(*skus)
@@ -42,6 +44,8 @@ def self.get_published_products_by_sku(*skus)
end
end
end
+
+ [response.to_array(:get_products_by_sku_response).first[:product]].flatten.compact
end
def self.get_products(batch_number = nil)
@@ -62,6 +66,9 @@ def self.get_products(batch_number = nil)
end
end
end
+
+ [response.to_array(:get_products_response).first[:product]].flatten.compact
+
end
def self.get_products_by_sku(*skus)
@@ -85,6 +92,8 @@ def self.get_products_by_sku(*skus)
end
end
end
+
+ [response.to_array(:get_products_by_sku_response).first[:product]].flatten.compact
end
private
Please sign in to comment.
Something went wrong with that request. Please try again.