storesapp-rb 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@ module StoresApp
2
2
  module Resources
3
3
  class Cart < StoresApp::StoresAppResource
4
4
  def items
5
- CartItem.find(:all, :from => "/v1cart_items.xml", :params => {'search[cart_id]' => self.id})
5
+ CartItem.find(:all, :from => "/v1//cart_items.xml", :params => {'search[cart_id]' => self.id})
6
6
  end
7
7
  end
8
8
  end
@@ -2,11 +2,11 @@ module StoresApp
2
2
  module Resources
3
3
  class CartItem < StoresApp::StoresAppResource
4
4
  def cart
5
- Cart.find(:first, :from => "/v1cart_items.xml", :params => {'search[cart_id_equals]' => self.cart_id})
5
+ Cart.find(:first, :from => "/v1/cart_items.xml", :params => {'search[cart_id_equals]' => self.cart_id})
6
6
  end
7
7
 
8
8
  def properties
9
- CartItemProperty.find(:all, :from => "/v1cart_item_properties.xml", :params => {'search[cart_item_id_equals]' => self.id})
9
+ CartItemProperty.find(:all, :from => "/v1/cart_item_properties.xml", :params => {'search[cart_item_id_equals]' => self.id})
10
10
  end
11
11
  end
12
12
  end
@@ -2,7 +2,7 @@ module StoresApp
2
2
  module Resources
3
3
  class CartItemProperty < StoresApp::StoresAppResource
4
4
  def item
5
- CartItem.find(:first, :from => "/v1cart_items.xml", :params => {'search[cart_item_id_equals]' => self.cart_item_id})
5
+ CartItem.find(:first, :from => "/v1/cart_items.xml", :params => {'search[cart_item_id_equals]' => self.cart_item_id})
6
6
  end
7
7
  end
8
8
  end
@@ -2,7 +2,7 @@ module StoresApp
2
2
  module Resources
3
3
  class Collection < StoresApp::StoresAppResource
4
4
  def products
5
- collection_products = CollectionProduct.find(:all, :from => "/v1collection_products.xml?search[collection_id_equals]=#{self.id}")
5
+ collection_products = CollectionProduct.find(:all, :from => "/v1/collection_products.xml?search[collection_id_equals]=#{self.id}")
6
6
  product_ids = collection_products.collect {|cp| cp.product_id}
7
7
  return Product.find(:all).select {|p| product_ids.include?(p.id)}
8
8
  end
@@ -16,7 +16,7 @@ module StoresApp
16
16
  def remove_product(options={})
17
17
  options.assert_valid_keys(:product_id)
18
18
  options.assert_required_keys(:product_id)
19
- CollectionProduct.find(:first, :from => "/v1collection_products.xml?search[collection_id_equals]=#{self.id}&search[product_id_equals]=#{options[:collection_id]}").destroy
19
+ CollectionProduct.find(:first, :from => "/v1/collection_products.xml?search[collection_id_equals]=#{self.id}&search[product_id_equals]=#{options[:collection_id]}").destroy
20
20
  end
21
21
 
22
22
  # def enable
@@ -2,11 +2,11 @@ module StoresApp
2
2
  module Resources
3
3
  class CollectionProduct < StoresApp::StoresAppResource
4
4
  def collection
5
- return Collection.find(:first, :from => "/v1collections.xml?search[collection_id_equals]=#{self.collection_id}")
5
+ return Collection.find(:first, :from => "/v1/collections.xml?search[collection_id_equals]=#{self.collection_id}")
6
6
  end
7
7
 
8
8
  def products
9
- return Product.find(:first, :from => "/v1products.xml?search[product_id_equals]=#{self.product_id}")
9
+ return Product.find(:first, :from => "/v1/products.xml?search[product_id_equals]=#{self.product_id}")
10
10
  end
11
11
  end
12
12
  end
@@ -2,7 +2,7 @@ module StoresApp
2
2
  module Resources
3
3
  class Order < StoresApp::StoresAppResource
4
4
  def items
5
- OrderItem.find(:all, :from => "/v1order_items.xml", :params => {'search[order_id]' => self.id})
5
+ OrderItem.find(:all, :from => "/v1/order_items.xml", :params => {'search[order_id]' => self.id})
6
6
  end
7
7
  end
8
8
  end
@@ -2,11 +2,11 @@ module StoresApp
2
2
  module Resources
3
3
  class OrderItem < StoresApp::StoresAppResource
4
4
  def order
5
- Order.find(:first, :from => "/v1order_items.xml", :params => {'search[order_id_equals]' => self.order_id})
5
+ Order.find(:first, :from => "/v1/order_items.xml", :params => {'search[order_id_equals]' => self.order_id})
6
6
  end
7
7
 
8
8
  def properties
9
- OrderItemProperty.find(:all, :from => "/v1order_item_properties.xml", :params => {'search[order_item_id_equals]' => self.id})
9
+ OrderItemProperty.find(:all, :from => "/v1/order_item_properties.xml", :params => {'search[order_item_id_equals]' => self.id})
10
10
  end
11
11
  end
12
12
  end
@@ -2,7 +2,7 @@ module StoresApp
2
2
  module Resources
3
3
  class OrderItemProperty < StoresApp::StoresAppResource
4
4
  def item
5
- OrderItem.find(:first, :from => "/v1order_items.xml", :params => {'search[order_item_id_equals]' => self.order_item_id})
5
+ OrderItem.find(:first, :from => "/v1/order_items.xml", :params => {'search[order_item_id_equals]' => self.order_item_id})
6
6
  end
7
7
  end
8
8
  end
@@ -2,21 +2,21 @@ module StoresApp
2
2
  module Resources
3
3
  class Product < StoresApp::StoresAppResource
4
4
  def collections
5
- collection_products = CollectionProduct.find(:all, :from => "/v1collection_products.xml?search[product_id_equals]=#{self.id}")
5
+ collection_products = CollectionProduct.find(:all, :from => "/v1/collection_products.xml?search[product_id_equals]=#{self.id}")
6
6
  collection_ids = collection_products.collect {|cp| cp.collection_id}
7
7
  return Collection.find(:all).select {|c| collection_ids.include?(c.id)}
8
8
  end
9
9
 
10
10
  def images
11
- ProductImage.find(:all, :from => "/v1product_images.xml?search[product_id_equals]=#{self.id}")
11
+ ProductImage.find(:all, :from => "/v1/product_images.xml?search[product_id_equals]=#{self.id}")
12
12
  end
13
13
 
14
14
  def properties
15
- ProductProperty.find(:all, :from => "/v1product_properties.xml?search[product_id_equals]=#{self.id}")
15
+ ProductProperty.find(:all, :from => "/v1/product_properties.xml?search[product_id_equals]=#{self.id}")
16
16
  end
17
17
 
18
18
  def variants
19
- Variant.find(:all, :from => "/v1variants.xml?search[product_id_equals]=#{self.id}")
19
+ Variant.find(:all, :from => "/v1/variants.xml?search[product_id_equals]=#{self.id}")
20
20
  end
21
21
 
22
22
  def add_collection(options={})
@@ -28,7 +28,7 @@ module StoresApp
28
28
  def remove_collection(options={})
29
29
  options.assert_valid_keys(:collection_id)
30
30
  options.assert_required_keys(:collection_id)
31
- CollectionProduct.find(:first, :from => "/v1collection_products.xml?search[product_id_equals]=#{self.id}&search[collection_id_equals]=#{options[:collection_id]}").destroy
31
+ CollectionProduct.find(:first, :from => "/v1/collection_products.xml?search[product_id_equals]=#{self.id}&search[collection_id_equals]=#{options[:collection_id]}").destroy
32
32
  end
33
33
 
34
34
  # def enable
@@ -2,7 +2,7 @@ module StoresApp
2
2
  module Resources
3
3
  class ProductImage < StoresApp::StoresAppResource
4
4
  def product
5
- Product.find(:first, :from => "/v1product.xml?search[product_id_equals]=#{self.product_id}")
5
+ Product.find(:first, :from => "/v1/product.xml?search[product_id_equals]=#{self.product_id}")
6
6
  end
7
7
  end
8
8
  end
@@ -2,7 +2,7 @@ module StoresApp
2
2
  module Resources
3
3
  class ProductProperty < StoresApp::StoresAppResource
4
4
  def product
5
- Product.find(:first, :from => "/v1product.xml?search[product_id_equals]=#{self.product_id}")
5
+ Product.find(:first, :from => "/v1/product.xml?search[product_id_equals]=#{self.product_id}")
6
6
  end
7
7
  end
8
8
  end
@@ -2,11 +2,11 @@ module StoresApp
2
2
  module Resources
3
3
  class Variant < StoresApp::StoresAppResource
4
4
  def product
5
- Product.find(:first, :from => "/v1product.xml?search[product_id_equals]=#{self.product_id}")
5
+ Product.find(:first, :from => "/v1/product.xml?search[product_id_equals]=#{self.product_id}")
6
6
  end
7
7
 
8
8
  def properties
9
- VariantProperty.find(:all, :from => "/v1variant_properties.xml?search[product_variant_id_equals]=#{self.id}")
9
+ VariantProperty.find(:all, :from => "/v1/variant_properties.xml?search[product_variant_id_equals]=#{self.id}")
10
10
  end
11
11
  end
12
12
  end
@@ -2,7 +2,7 @@ module StoresApp
2
2
  module Resources
3
3
  class VariantProperty < StoresApp::StoresAppResource
4
4
  def variant
5
- Variant.find(:first, :from => "/v1variants.xml?search[variant_id_equals]=#{self.variant_id}")
5
+ Variant.find(:first, :from => "/v1/variants.xml?search[variant_id_equals]=#{self.variant_id}")
6
6
  end
7
7
  end
8
8
  end
data/storesapp.gemspec CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "storesapp-rb"
6
- s.version = "0.2.0"
6
+ s.version = "0.2.1"
7
7
  s.authors = ["Next Feature"]
8
8
  s.summary = "A wrapper for the StoresApp API. See http://api.storesapp.com for details."
9
9
  s.date = Date.today.to_s
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: storesapp-rb
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Next Feature