Permalink
Browse files

formatting API responses

  • Loading branch information...
1 parent 4324091 commit b7e62b08f3e5a7ee721a6c7381f13829d4dbbaa9 @jzw jzw committed Sep 19, 2012
Showing with 15 additions and 0 deletions.
  1. +4 −0 lib/powa_api/order_service.rb
  2. +2 −0 lib/powa_api/powa_service.rb
  3. +9 −0 lib/powa_api/product_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
@@ -21,6 +21,8 @@ def self.get_publish_info
end
end
end
+
+ response.to_array(:get_publish_info_response).first
end
protected
@@ -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

0 comments on commit b7e62b0

Please sign in to comment.