spree-wrap 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4e54151ebb7d63d07ea4f9fafb4d92116e443b57
4
- data.tar.gz: d556fd469e84e944a5155cfda374364f1596fba0
3
+ metadata.gz: 9ecc1cac976cdb50b45d7ca8adea82c3e76180e6
4
+ data.tar.gz: 1f0bf376c66bc455f756ae0df70c7b0ad7857bd8
5
5
  SHA512:
6
- metadata.gz: 67569dae2d511d5ed572078d5534f92ddd03740d4c6342e41e8bf61f510d1ee92013ca65ebb1a67e4e98f4769d70a01e3b77ef9cc5371ea4ec0b86dc5f74bb26
7
- data.tar.gz: 18e6e17552afe7b83665cc442d085834d16d0ed7ed4af91e55a4e2d915ee2bba855f67e937e1d6a600258875e0c9357ef81edc4e0195bbe5b2fe443fa61e1155
6
+ metadata.gz: 8a4e481c4e1d45a0707ae988c7dd7be1fbb022d70ad512011c8f058c9a562f20f85ed5d02d32e321e48967c8bdc707b1cde543c03aed40bc09b89f0383879109
7
+ data.tar.gz: aa2ecad53407e6974d9167bd22776b4d04d5851a8ae7fd3586053bd4cfa6915ed8da5517aedd0386907a4af4f1543a0d4df2580bd7477f8c18f1152fe62a942b
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ *.DS_Store
1
2
  *.gem
2
3
  *.rbc
3
4
  .bundle
@@ -16,3 +17,4 @@ test/tmp
16
17
  test/version_tmp
17
18
  tmp
18
19
  build
20
+ .repl_history
data/Rakefile CHANGED
@@ -1,5 +1,6 @@
1
1
  $:.unshift("/Library/RubyMotion/lib")
2
2
  require 'motion/project/template/ios'
3
+ require "bundler/gem_tasks"
3
4
 
4
5
  # Bubblewrap
5
6
  require 'bubble-wrap/core'
@@ -9,4 +10,3 @@ Bundler.setup
9
10
  Bundler.require
10
11
  require 'bubble-wrap/test'
11
12
  require 'webstub'
12
- require "bundler/gem_tasks"
@@ -1,5 +1,33 @@
1
1
  require "spree/wrap/version"
2
- BubbleWrap.require 'motion/spree.rb'
2
+ require "motion-support/concern"
3
+
4
+ BubbleWrap.require 'motion/spree/inflector.rb'
5
+
6
+ #
7
+ # Models
8
+ #
3
9
  BubbleWrap.require 'motion/spree/model.rb'
10
+ BubbleWrap.require 'motion/spree/country.rb'
4
11
  BubbleWrap.require 'motion/spree/product.rb'
12
+ BubbleWrap.require 'motion/spree/product_property.rb'
13
+ BubbleWrap.require 'motion/spree/taxonomy.rb'
14
+ BubbleWrap.require 'motion/spree/variant.rb'
15
+ BubbleWrap.require 'motion/spree/zone.rb'
16
+
17
+ #
18
+ # API Queries
19
+ #
20
+ BubbleWrap.require 'motion/spree/api/resource_name.rb'
21
+ BubbleWrap.require 'motion/spree/api/query.rb'
22
+ BubbleWrap.require 'motion/spree/api/uri.rb'
23
+ BubbleWrap.require 'motion/spree/api/country.rb'
5
24
  BubbleWrap.require 'motion/spree/api/product.rb'
25
+ BubbleWrap.require 'motion/spree/api/product_property.rb'
26
+ BubbleWrap.require 'motion/spree/api/taxonomy.rb'
27
+ BubbleWrap.require 'motion/spree/api/variant.rb'
28
+ BubbleWrap.require 'motion/spree/api/zone.rb'
29
+
30
+ #
31
+ # Main Module
32
+ #
33
+ BubbleWrap.require 'motion/spree.rb'
@@ -1,5 +1,5 @@
1
1
  module Spree
2
2
  module Wrap
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
@@ -1,11 +1,33 @@
1
+ #
2
+ # This module contains all the methods required to consume the Spree API.
3
+ #
4
+ # Refer to the modules on the Spree::API namespace for more information.
5
+ #
6
+ # Spree::API::Country
7
+ # Spree::API::Product
8
+ # Spree::API::Taxonomy
9
+ # Spree::API::Variant
10
+ # Spree::API::Zone
11
+ #
1
12
  module Spree
13
+ #
14
+ # Getter for the endpoint URL
15
+ #
2
16
  def self.endpoint
3
17
  @endpoint
4
18
  end
5
19
 
20
+ #
21
+ # Setter for the endpoint URL
22
+ #
6
23
  def self.endpoint=(uri)
7
24
  @endpoint = uri
8
25
  end
9
26
 
10
- include Spree::API::Product
27
+ extend Spree::API::Country
28
+ extend Spree::API::Product
29
+ extend Spree::API::ProductProperty
30
+ extend Spree::API::Taxonomy
31
+ extend Spree::API::Variant
32
+ extend Spree::API::Zone
11
33
  end
@@ -0,0 +1,46 @@
1
+ module Spree
2
+ module API
3
+ #
4
+ # This module defines all the API calls related to Countries.
5
+ # All results return Spree::Country objects.
6
+ #
7
+ # API Reference
8
+ #
9
+ # http://api.spreecommerce.com/v1/countries
10
+ #
11
+ # This Module is included in the Spree Module so you should call its
12
+ # methods directly from Spree.
13
+ #
14
+ # Spree.countries do |countries|
15
+ # # ...
16
+ # end
17
+ #
18
+ module Country
19
+ extend Spree::API::ResourceName
20
+ include Spree::API::Query
21
+ include Spree::API::URI
22
+
23
+ #
24
+ # Retrieve a list of all countries by making this request:
25
+ #
26
+ # Spree.countries do |countries|
27
+ # # ..
28
+ # end
29
+ #
30
+ def countries(&block)
31
+ collection_query("countries", Spree::Country, Spree.countries_uri, &block)
32
+ end
33
+
34
+ #
35
+ # Retrieve details about a particular country:
36
+ #
37
+ # Spree.country(1) do |country|
38
+ # # ...
39
+ # end
40
+ #
41
+ def country(id, &block)
42
+ object_query(Spree::Country, country_uri(id), &block)
43
+ end
44
+ end
45
+ end
46
+ end
@@ -1,29 +1,69 @@
1
1
  module Spree
2
2
  module API
3
+ #
4
+ # This module defines all the API calls related to Products.
5
+ # All results return Spree::Product objects.
6
+ #
7
+ # API Reference
8
+ #
9
+ # http://api.spreecommerce.com/v1/products
10
+ #
11
+ # This Module is included in the Spree Module so you should call its
12
+ # methods directly from Spree.
13
+ #
14
+ # Spree.products do |products|
15
+ # # ...
16
+ # end
17
+ #
3
18
  module Product
4
- def self.included(base)
5
- base.send(:extend, ClassMethods)
6
- end
7
-
8
- module ClassMethods
9
- def products(&block)
10
- json = []
11
-
12
- BW::HTTP.get(Spree.products_uri) do |response|
13
- json = BW::JSON.parse(response.body.to_str)
14
- products = json["products"].map do |product_json|
15
- Spree::Product.new(product_json)
16
- end
19
+ extend Spree::API::ResourceName
20
+ include Spree::API::Query
21
+ include Spree::API::URI
17
22
 
18
- block.call products
19
- end
23
+ #
24
+ # List products visible to the authenticated user.
25
+ #
26
+ # Spree.products do |products|
27
+ # # ..
28
+ # end
29
+ #
30
+ def products(&block)
31
+ collection_query("products", Spree::Product, Spree.products_uri, &block)
32
+ end
20
33
 
21
- json
22
- end
34
+ #
35
+ # To view the details for a single product, make a request using that product's permalink:
36
+ #
37
+ # Spree.product("a-product") do |product|
38
+ # # ...
39
+ # end
40
+ #
41
+ # You may also query by the product's id attribute:
42
+ #
43
+ # Spree.product("id") do |product|
44
+ # # ...
45
+ # end
46
+ #
47
+ # Note that the API will attempt a permalink lookup before an ID lookup.
48
+ #
49
+ def product(id, &block)
50
+ object_query(Spree::Product, product_uri(id), &block)
51
+ end
23
52
 
24
- def products_uri
25
- Spree.endpoint + "/products"
26
- end
53
+ #
54
+ # To search for a particular product, make a request like this:
55
+ #
56
+ # Spree.product_search("q[name_cont]=Spree") do |p|
57
+ # # ...
58
+ # end
59
+ #
60
+ # The searching API is provided through the Ransack gem which Spree
61
+ # depends on. The name_cont here is called a predicate, and you can
62
+ # learn more about them by reading about
63
+ # {Predicates on the Ransack wiki}[https://github.com/ernie/ransack/wiki/Basic-Searching].
64
+ #
65
+ def product_search(query, &block)
66
+ collection_query("products", Spree::Product, Spree.product_search_uri(query), &block)
27
67
  end
28
68
  end
29
69
  end
@@ -0,0 +1,55 @@
1
+ module Spree
2
+ module API
3
+ # == Product Properties
4
+ #
5
+ # === API Reference
6
+ #
7
+ # http://api.spreecommerce.com/v1/product/properties/
8
+ #
9
+ module ProductProperty
10
+ extend Spree::API::ResourceName
11
+ include Spree::API::Query
12
+ include Spree::API::URI
13
+
14
+ #
15
+ # Retrieve a list of all product properties for a product by making this request:
16
+ #
17
+ # product_id = 1
18
+ # Spree.product_properties(1) do |property|
19
+ # # ...
20
+ # end
21
+ #
22
+ def product_properties(id, &block)
23
+ collection_query("product_properties", Spree::ProductProperty,
24
+ product_properties_uri(id), &block)
25
+ end
26
+
27
+ #
28
+ # To search for a particular product property, make a request like this:
29
+ #
30
+ # product_id = 1
31
+ # query = "q[property_name_cont]=Type"
32
+ #
33
+ # Spree.product_property_search(product_id, query) do |p|
34
+ # # ...
35
+ # end
36
+ # The searching API is provided through the Ransack gem which
37
+ # Spree depends on. The property_name_cont here is called a predicate,
38
+ # and you can learn more about them by reading
39
+ # about {Predicates on the Ransack wiki}[https://github.com/ernie/ransack/wiki/Basic-Searching].
40
+ #
41
+ def product_property_search(product_id, query, &block)
42
+ collection_query("product_properties", Spree::ProductProperty,
43
+ Spree.product_property_search_uri(product_id, query), &block)
44
+ end
45
+
46
+ def product_properties_uri(product_id)
47
+ Spree.product_uri(product_id) + "/product_properties"
48
+ end
49
+
50
+ def product_property_search_uri(product_id, query)
51
+ Spree.product_uri(product_id) + "/product_properties?#{query}"
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,33 @@
1
+ module Spree
2
+ module API
3
+ module Query
4
+ def collection_query(collection_name, object_class, uri, &block)
5
+ if block_given?
6
+ BW::HTTP.get(uri) do |response|
7
+ json = BW::JSON.parse(response.body.to_str)
8
+ collection = (json[collection_name] || []).map do |object_json|
9
+ object_class.new(object_json)
10
+ end
11
+
12
+ block.call collection
13
+ end
14
+ else
15
+ BW::HTTP.get(uri)
16
+ end
17
+ end
18
+
19
+ def object_query(object_class, uri, &block)
20
+ if block_given?
21
+ BW::HTTP.get(uri) do |response|
22
+ json = BW::JSON.parse(response.body.to_str)
23
+ object = object_class.new(json)
24
+
25
+ block.call object
26
+ end
27
+ else
28
+ BW::HTTP.get(uri)
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,13 @@
1
+ module Spree
2
+ module API
3
+ module ResourceName
4
+ def resource_name
5
+ @resource_name ||= self.to_s.underscore.split('/').last
6
+ end
7
+
8
+ def resource_name_plural
9
+ @resource_name_plural ||= Spree::Inflector.pluralize resource_name
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,47 @@
1
+ module Spree
2
+ module API
3
+ #
4
+ # This module defines all the API calls related to Taxonomies.
5
+ # All results return Spree::Taxonomy objects.
6
+ #
7
+ # API Reference
8
+ #
9
+ # http://api.spreecommerce.com/v1/taxonomies
10
+ #
11
+ # This Module is included in the Spree Module so you should call its
12
+ # methods directly from Spree.
13
+ #
14
+ # Spree.taxonomies do |taxonomies|
15
+ # # ...
16
+ # end
17
+ #
18
+ module Taxonomy
19
+ extend Spree::API::ResourceName
20
+ include Spree::API::Query
21
+ include Spree::API::URI
22
+
23
+ #
24
+ # To get a list of all the taxonomies, including their root nodes and
25
+ # the immediate children for the root node, make a request like this:
26
+ #
27
+ # Spree.taxonomies do |taxonomies|
28
+ # # ..
29
+ # end
30
+ #
31
+ def taxonomies(&block)
32
+ collection_query("taxonomies", Spree::Taxonomy, Spree.taxonomies_uri, &block)
33
+ end
34
+
35
+ # To get information for a single taxonomy, including its root node and
36
+ # the immediate children of the root node, make a request like this:
37
+ #
38
+ # Spree.taxonomy(1) do |taxonomy|
39
+ # # ...
40
+ # end
41
+ #
42
+ def taxonomy(id, &block)
43
+ object_query(Spree::Taxonomy, taxonomy_uri(id), &block)
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,19 @@
1
+ module Spree
2
+ module API
3
+ module URI
4
+ def self.included(base)
5
+ base.send :define_method, "#{base.resource_name_plural}_uri" do
6
+ "#{Spree.endpoint}/#{base.resource_name_plural}"
7
+ end
8
+
9
+ base.send :define_method, "#{base.resource_name}_uri" do |id|
10
+ "#{Spree.endpoint}/#{base.resource_name_plural}/#{id}"
11
+ end
12
+
13
+ base.send :define_method, "#{base.resource_name}_search_uri" do |query|
14
+ "#{Spree.endpoint}/#{base.resource_name_plural}?#{query}"
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,52 @@
1
+ module Spree
2
+ module API
3
+ #
4
+ # This module defines all the API calls related to Variants.
5
+ # All results return Spree::Variant objects.
6
+ #
7
+ # API Reference
8
+ #
9
+ # http://api.spreecommerce.com/v1/variants
10
+ #
11
+ # This Module is included in the Spree Module so you should call its
12
+ # methods directly from Spree.
13
+ #
14
+ # Spree.variants do |variants|
15
+ # # ...
16
+ # end
17
+ #
18
+ module Variant
19
+ extend Spree::API::ResourceName
20
+ include Spree::API::Query
21
+ include Spree::API::URI
22
+
23
+ # To return a paginated list of all variants within the store, make this request:
24
+ #
25
+ # Spree.variants do |variants|
26
+ # # ..
27
+ # end
28
+ #
29
+ def variants(&block)
30
+ collection_query("variants", Spree::Variant, Spree.variants_uri, &block)
31
+ end
32
+
33
+ #
34
+ # To view the details for a single variant, make a request using that
35
+ # variant's id, along with its product_id:
36
+ #
37
+ # product_id = 1
38
+ #
39
+ # Spree.product_variants(product_id) |v|
40
+ # # ...
41
+ # end
42
+ #
43
+ def product_variants(product_id, &block)
44
+ collection_query("variants", Spree::Variant, Spree.product_variants_uri(product_id), &block)
45
+ end
46
+
47
+ def product_variants_uri(product_id)
48
+ Spree.product_uri(product_id) + "/variants"
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,55 @@
1
+ module Spree
2
+ module API
3
+ #
4
+ # This module defines all the API calls related to Zones.
5
+ # All results return Spree::Zone objects.
6
+ #
7
+ # API Reference
8
+ #
9
+ # http://api.spreecommerce.com/v1/zones
10
+ #
11
+ # This Module is included in the Spree Module so you should call its
12
+ # methods directly from Spree.
13
+ #
14
+ # Spree.zones do |zones|
15
+ # # ...
16
+ # end
17
+ #
18
+ module Zone
19
+ extend Spree::API::ResourceName
20
+ include Spree::API::Query
21
+ include Spree::API::URI
22
+
23
+ #
24
+ # List zones visible to the authenticated user.
25
+ #
26
+ # Spree.zones do |zones|
27
+ # # ..
28
+ # end
29
+ #
30
+ def zones(&block)
31
+ collection_query("zones", Spree::Zone, Spree.zones_uri, &block)
32
+ end
33
+
34
+ #
35
+ # To view the details for a single zone, make a request using that zone's permalink:
36
+ #
37
+ # Spree.zone("a-zone") do |zone|
38
+ # # ...
39
+ # end
40
+ #
41
+ # You may also query by the zone's id attribute:
42
+ #
43
+ # Spree.zone("id") do |zone|
44
+ # # ...
45
+ # end
46
+ #
47
+ # Note that the API will attempt a permalink lookup before an ID lookup.
48
+ #
49
+ def zone(id, &block)
50
+ object_query(Spree::Zone, zone_uri(id), &block)
51
+ end
52
+ end
53
+ end
54
+ end
55
+
@@ -0,0 +1,7 @@
1
+ module Spree
2
+ class Country
3
+ include Spree::Model
4
+
5
+ define_model_attributes :id, :iso_name, :iso, :name, :iso3, :numcode, :states
6
+ end
7
+ end
@@ -0,0 +1,36 @@
1
+ module Spree
2
+ #
3
+ # Handles the pluralization of resource names for the API classes
4
+ #
5
+ class Inflector
6
+ def self.inflections
7
+ @inflections ||= []
8
+ end
9
+
10
+ def self.inflections=(value)
11
+ @inflections = value
12
+ end
13
+
14
+ def self.pluralize(singular)
15
+ inflection = self.inflections.detect { |i| i[:singular] == singular }
16
+ raise UndefinedInflection unless inflection
17
+ inflection[:plural]
18
+ end
19
+
20
+ def self.inflection(singular, plural)
21
+ inflections << Inflection.new(singular, plural)
22
+ end
23
+
24
+ Inflection = Struct.new(:singular, :plural)
25
+
26
+ class UndefinedInflection < Exception ; end
27
+ end
28
+ end
29
+
30
+ Spree::Inflector.inflection 'cat', 'cats'
31
+ Spree::Inflector.inflection 'country', 'countries'
32
+ Spree::Inflector.inflection 'product', 'products'
33
+ Spree::Inflector.inflection 'product_property', 'product_properties'
34
+ Spree::Inflector.inflection 'taxonomy', 'taxonomies'
35
+ Spree::Inflector.inflection 'variant', 'variants'
36
+ Spree::Inflector.inflection 'zone', 'zones'
@@ -1,10 +1,14 @@
1
1
  module Spree
2
+ #
3
+ # This module defines common behavior for all the Models
4
+ #
2
5
  module Model
3
- def self.included(base)
4
- base.send(:extend, ClassMethods)
5
- end
6
+ extend MotionSupport::Concern
6
7
 
7
8
  module ClassMethods
9
+ #
10
+ # Define the properties or attributes of the model.
11
+ #
8
12
  def define_model_attributes(*attrs)
9
13
  define_method :attributes do
10
14
  attrs
@@ -16,6 +20,9 @@ module Spree
16
20
  end
17
21
  end
18
22
 
23
+ #
24
+ # The initializer receives a hash with the attributes
25
+ #
19
26
  def initialize(attributes = {})
20
27
  self.attributes.each do |attr|
21
28
  send("#{attr}=", attributes[attr.to_s])
@@ -0,0 +1,7 @@
1
+ module Spree
2
+ class ProductProperty
3
+ include Spree::Model
4
+
5
+ define_model_attributes :id, :product_id, :property_id, :value, :property_name
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module Spree
2
+ class Taxonomy
3
+ include Spree::Model
4
+
5
+ define_model_attributes :id, :name, :root
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ module Spree
2
+ class Variant
3
+ include Spree::Model
4
+
5
+ define_model_attributes :id, :stock_items, :option_values, :permalink,
6
+ :sku, :weight, :product_id, :images, :depth, :price, :height, :name,
7
+ :width, :cost_price, :is_master
8
+ end
9
+ end
@@ -0,0 +1,7 @@
1
+ module Spree
2
+ class Zone
3
+ include Spree::Model
4
+
5
+ define_model_attributes :id, :name, :descriptions, :zone_members
6
+ end
7
+ end
@@ -1,31 +1,16 @@
1
1
  describe Spree::API::Product do
2
- extend WebStub::SpecHelpers
3
-
2
+ #
3
+ # Legacy tests, now work as semi-integration tests
4
+ #
4
5
  describe ".products_uri" do
5
- it "returns the endpoint path + the products path" do
6
+ it "returns the complete URI for the list of products" do
6
7
  Spree.products_uri.should == Spree.endpoint + "/products"
7
8
  end
8
9
  end
9
10
 
10
- describe ".products" do
11
- before do
12
- disable_network_access!
13
- stub_request(:get, Spree.products_uri).
14
- to_return(json: load_webstub_response("products.json"))
15
-
16
- @products = nil
17
- Spree.products do |p|
18
- @products = p
19
- resume
20
- end
21
-
22
- wait_max 1 do
23
- @products
24
- end
25
- end
26
-
27
- it "returns an array of Spree::Product objects" do
28
- @products.all? { |p| p.is_a?(Spree::Product) }.should == true
11
+ describe ".product_uri" do
12
+ it "returns the complete URI for a product" do
13
+ Spree.product_uri(1).should == Spree.products_uri + "/1"
29
14
  end
30
15
  end
31
16
  end
@@ -0,0 +1,69 @@
1
+ module Spree
2
+ class Foo
3
+ include Spree::Model
4
+
5
+ define_model_attributes :id, :name
6
+ end
7
+
8
+ module API
9
+ class Foo
10
+ extend Spree::API::Query
11
+ end
12
+ end
13
+ end
14
+
15
+ describe Spree::API::Query do
16
+ extend WebStub::SpecHelpers
17
+
18
+ before do
19
+ disable_network_access!
20
+ end
21
+
22
+ describe "#collection_query" do
23
+ before do
24
+ @uri = "http://example.com/api/foos"
25
+ @data = { foos: [{ id: "1", name: "Foo 1" }, { id: "2", name: "Foo 2" }] }
26
+ stub_request(:get, @uri).
27
+ to_return(json: @data)
28
+
29
+ Spree::API::Foo.collection_query("foos", Spree::Foo, @uri) do |f|
30
+ @foos = f
31
+ resume
32
+ end
33
+
34
+ # Wait for the BW::HTTP Thread
35
+ wait_max 1 { @foos }
36
+ end
37
+
38
+ it "maps received data to objects of the specified class" do
39
+ @foos.each_with_index do |f, i|
40
+ f.is_a?(Spree::Foo).should.be.true
41
+ f.id.should.equal @data[:foos][i][:id]
42
+ f.name.should.equal @data[:foos][i][:name]
43
+ end
44
+ end
45
+ end
46
+
47
+ describe "#object_query" do
48
+ before do
49
+ @uri = "http://example.com/api/foos/1"
50
+ @data = { id: "1", name: "Foo 1" }
51
+ stub_request(:get, @uri).
52
+ to_return(json: @data)
53
+
54
+ Spree::API::Foo.object_query(Spree::Foo, @uri) do |f|
55
+ @foo = f
56
+ resume
57
+ end
58
+
59
+ # Wait for the BW::HTTP Thread
60
+ wait_max 1 { @foo }
61
+ end
62
+
63
+ it "maps received data to an object of the specified class" do
64
+ @foo.is_a?(Spree::Foo).should.be.true
65
+ @foo.id.should.equal @data[:id]
66
+ @foo.name.should.equal @data[:name]
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,15 @@
1
+ module Foo
2
+ class Cat
3
+ extend Spree::API::ResourceName
4
+ end
5
+ end
6
+
7
+ describe Spree::API::ResourceName do
8
+ it "defines the resource_name method" do
9
+ Foo::Cat.resource_name.should == "cat"
10
+ end
11
+
12
+ it "defines the resource_name_plural method" do
13
+ Foo::Cat.resource_name_plural.should == "cats"
14
+ end
15
+ end
@@ -0,0 +1,30 @@
1
+ Spree::Inflector.inflection 'animal', 'animals'
2
+
3
+ module Animal
4
+ extend Spree::API::ResourceName
5
+ include Spree::API::URI
6
+ end
7
+
8
+ class Dog
9
+ extend Animal
10
+ end
11
+
12
+ describe Spree::API::URI do
13
+ describe ".resources_uri" do
14
+ it "builds a resource collection URI" do
15
+ Dog.animals_uri.should == "http://example.com/api/animals"
16
+ end
17
+ end
18
+
19
+ describe ".resource_uri" do
20
+ it "builds a single resource URI" do
21
+ Dog.animal_uri(1).should == "http://example.com/api/animals/1"
22
+ end
23
+ end
24
+
25
+ describe ".search_uri" do
26
+ it "builds a search URI" do
27
+ Dog.animal_search_uri("q").should == "http://example.com/api/animals?q"
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,28 @@
1
+ describe Spree::Inflector do
2
+ describe ".pluralize" do
3
+ describe "defined Inflection" do
4
+ it "adds an s to the end of the specified singular" do
5
+ Spree::Inflector.pluralize("cat").should == "cats"
6
+ end
7
+
8
+ it "pluralizes country" do
9
+ Spree::Inflector.pluralize("country").should == "countries"
10
+ end
11
+ end
12
+
13
+ describe "undefined Inflection" do
14
+ it "raises Spree::Inflector::UndefinedInflection" do
15
+ lambda {
16
+ Spree::Inflector.pluralize("42")
17
+ }.should.raise(Spree::Inflector::UndefinedInflection)
18
+ end
19
+ end
20
+ end
21
+
22
+ describe ".inflections" do
23
+ it "defines a new inflection" do
24
+ Spree::Inflector.inflection 'foo', 'bar'
25
+ Spree::Inflector.pluralize('foo').should == 'bar'
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,8 @@
1
+ describe Spree do
2
+ describe ".endpoint" do
3
+ it "sets and gets the API endpoint" do
4
+ Spree.endpoint = "http://example.com"
5
+ Spree.endpoint.should == "http://example.com"
6
+ end
7
+ end
8
+ end
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_dependency "bubble-wrap"
22
+ spec.add_dependency "motion-support"
22
23
 
23
24
  spec.add_development_dependency "bundler", "~> 1.3"
24
25
  spec.add_development_dependency "rake"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree-wrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Padilla
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-18 00:00:00.000000000 Z
11
+ date: 2013-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bubble-wrap
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: motion-support
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -74,7 +88,6 @@ extensions: []
74
88
  extra_rdoc_files: []
75
89
  files:
76
90
  - .gitignore
77
- - .repl_history
78
91
  - Gemfile
79
92
  - LICENSE.txt
80
93
  - README.md
@@ -82,14 +95,32 @@ files:
82
95
  - lib/spree/wrap.rb
83
96
  - lib/spree/wrap/version.rb
84
97
  - motion/spree.rb
98
+ - motion/spree/api/country.rb
85
99
  - motion/spree/api/product.rb
100
+ - motion/spree/api/product_property.rb
101
+ - motion/spree/api/query.rb
102
+ - motion/spree/api/resource_name.rb
103
+ - motion/spree/api/taxonomy.rb
104
+ - motion/spree/api/uri.rb
105
+ - motion/spree/api/variant.rb
106
+ - motion/spree/api/zone.rb
107
+ - motion/spree/country.rb
108
+ - motion/spree/inflector.rb
86
109
  - motion/spree/model.rb
87
110
  - motion/spree/product.rb
111
+ - motion/spree/product_property.rb
112
+ - motion/spree/taxonomy.rb
113
+ - motion/spree/variant.rb
114
+ - motion/spree/zone.rb
88
115
  - spec/spec_helper.rb
89
116
  - spec/spree/api/product_spec.rb
117
+ - spec/spree/api/query_spec.rb
118
+ - spec/spree/api/resource_name_spec.rb
119
+ - spec/spree/api/uri_spec.rb
120
+ - spec/spree/inflector_spec.rb
90
121
  - spec/spree/model_spec.rb
91
122
  - spec/spree/product_spec.rb
92
- - spec/support/webstub/products.json
123
+ - spec/spree_spec.rb
93
124
  - spree-wrap.gemspec
94
125
  homepage: ''
95
126
  licenses:
@@ -118,6 +149,10 @@ summary: Consumer for Spree API on Rubymotion
118
149
  test_files:
119
150
  - spec/spec_helper.rb
120
151
  - spec/spree/api/product_spec.rb
152
+ - spec/spree/api/query_spec.rb
153
+ - spec/spree/api/resource_name_spec.rb
154
+ - spec/spree/api/uri_spec.rb
155
+ - spec/spree/inflector_spec.rb
121
156
  - spec/spree/model_spec.rb
122
157
  - spec/spree/product_spec.rb
123
- - spec/support/webstub/products.json
158
+ - spec/spree_spec.rb
@@ -1,27 +0,0 @@
1
- File
2
- File.open("spec/support/webstub/products.json")
3
- File.open("./spec/support/webstub/products.json")
4
- __FILE__
5
- exit
6
- File.expand_path("/Users/dab/spree/spree-wrap/spec/spree/api/product_spec.rb")
7
- File.expand_path("/Users/dab/spree/spree-wrap/spec/spree/api/product_spec.rb", "..")
8
- File.expand_path("/Users/dab/spree/spree-wrap/spec/spree/api/product_spec.rb", "..", "..")
9
- File.expand_path("/Users/dab/spree/spree-wrap/spec/spree/api/product_spec.rb")
10
- File.dir_name("/Users/dab/spree/spree-wrap/spec/spree/api/product_spec.rb")
11
- File.dirname("/Users/dab/spree/spree-wrap/spec/spree/api/product_spec.rb")
12
- APP_ROOT
13
- APPLICATION_ROOT
14
- APP_ROOT
15
- ROOT
16
- ROOT_PATH
17
- Application
18
- Motion
19
- Motion::Project
20
- BW
21
- App
22
- App.resources_path
23
- App.document_path
24
- exit
25
- exit
26
- exit
27
- exit
@@ -1 +0,0 @@
1
- {"count":16,"total_count":16,"current_page":1,"per_page":25,"pages":1,"products":[{"id":1,"name":"Ruby on Rails Tote","description":"Molestias alias sed debitis labore optio. Veniam in exercitationem eaque aut. Quas deleniti omnis et vel cupiditate.","price":"15.99","available_on":"2013-06-12T04:09:25Z","permalink":"ruby-on-rails-tote","meta_description":null,"meta_keywords":null,"taxon_ids":[4],"variants":[{"id":1,"name":"Ruby on Rails Tote","sku":"ROR-00011","price":"15.99","weight":null,"height":null,"width":null,"depth":null,"is_master":true,"cost_price":"17.0","permalink":"ruby-on-rails-tote","count_on_hand":10,"option_values":[],"images":[{"id":21,"position":1,"attachment_content_type":"image/jpeg","attachment_file_name":"ror_tote.jpeg","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:44Z","attachment_width":360,"attachment_height":360,"alt":null,"viewable_type":"Spree::Variant","viewable_id":1,"attachment_url":"/spree/products/21/product/ror_tote.jpeg?1371010184"},{"id":22,"position":2,"attachment_content_type":"image/jpeg","attachment_file_name":"ror_tote_back.jpeg","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:45Z","attachment_width":360,"attachment_height":360,"alt":null,"viewable_type":"Spree::Variant","viewable_id":1,"attachment_url":"/spree/products/22/product/ror_tote_back.jpeg?1371010185"}]}],"option_types":[],"product_properties":[{"id":25,"product_id":1,"property_id":9,"value":"Tote","property_name":"Type"},{"id":26,"product_id":1,"property_id":10,"value":"15\" x 18\" x 6\"","property_name":"Size"},{"id":27,"product_id":1,"property_id":11,"value":"Canvas","property_name":"Material"}],"reviews":[],"related_products":[]},{"id":2,"name":"Ruby on Rails Bag","description":"Molestias alias sed debitis labore optio. Veniam in exercitationem eaque aut. Quas deleniti omnis et vel cupiditate.","price":"22.99","available_on":"2013-06-12T04:09:25Z","permalink":"ruby-on-rails-bag","meta_description":null,"meta_keywords":null,"taxon_ids":[4],"variants":[{"id":2,"name":"Ruby on Rails Bag","sku":"ROR-00012","price":"22.99","weight":null,"height":null,"width":null,"depth":null,"is_master":true,"cost_price":"21.0","permalink":"ruby-on-rails-bag","count_on_hand":10,"option_values":[],"images":[{"id":23,"position":1,"attachment_content_type":"image/jpeg","attachment_file_name":"ror_bag.jpeg","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:46Z","attachment_width":360,"attachment_height":360,"alt":null,"viewable_type":"Spree::Variant","viewable_id":2,"attachment_url":"/spree/products/23/product/ror_bag.jpeg?1371010186"}]}],"option_types":[],"product_properties":[{"id":28,"product_id":2,"property_id":9,"value":"Messenger","property_name":"Type"},{"id":29,"product_id":2,"property_id":10,"value":"14 1/2\" x 12\" x 5\"","property_name":"Size"},{"id":30,"product_id":2,"property_id":11,"value":"600 Denier Polyester","property_name":"Material"}],"reviews":[],"related_products":[]},{"id":3,"name":"Ruby on Rails Baseball Jersey","description":"Molestias alias sed debitis labore optio. Veniam in exercitationem eaque aut. Quas deleniti omnis et vel cupiditate.","price":"19.99","available_on":"2013-06-12T04:09:25Z","permalink":"ruby-on-rails-baseball-jersey","meta_description":null,"meta_keywords":null,"taxon_ids":[8],"variants":[{"id":17,"name":"Ruby on Rails Baseball Jersey","sku":"ROR-00001","price":"19.99","weight":null,"height":null,"width":null,"depth":null,"is_master":false,"cost_price":"17.0","permalink":"ruby-on-rails-baseball-jersey","count_on_hand":10,"option_values":[{"id":15,"name":"Small","presentation":"S","option_type_name":"tshirt-size","option_type_id":1},{"id":40,"name":"Red","presentation":"Red","option_type_name":"tshirt-color","option_type_id":2}],"images":[{"id":1,"position":1,"attachment_content_type":"image/png","attachment_file_name":"ror_baseball_jersey_red.png","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:29Z","attachment_width":240,"attachment_height":240,"alt":null,"viewable_type":"Spree::Variant","viewable_id":17,"attachment_url":"/spree/products/1/product/ror_baseball_jersey_red.png?1371010169"},{"id":2,"position":2,"attachment_content_type":"image/png","attachment_file_name":"ror_baseball_jersey_back_red.png","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:30Z","attachment_width":240,"attachment_height":240,"alt":null,"viewable_type":"Spree::Variant","viewable_id":17,"attachment_url":"/spree/products/2/product/ror_baseball_jersey_back_red.png?1371010170"}]},{"id":18,"name":"Ruby on Rails Baseball Jersey","sku":"ROR-00002","price":"19.99","weight":null,"height":null,"width":null,"depth":null,"is_master":false,"cost_price":"17.0","permalink":"ruby-on-rails-baseball-jersey","count_on_hand":10,"option_values":[{"id":15,"name":"Small","presentation":"S","option_type_name":"tshirt-size","option_type_id":1},{"id":7,"name":"Blue","presentation":"Blue","option_type_name":"tshirt-color","option_type_id":2}],"images":[{"id":3,"position":1,"attachment_content_type":"image/png","attachment_file_name":"ror_baseball_jersey_blue.png","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:31Z","attachment_width":240,"attachment_height":240,"alt":null,"viewable_type":"Spree::Variant","viewable_id":18,"attachment_url":"/spree/products/3/product/ror_baseball_jersey_blue.png?1371010171"},{"id":4,"position":2,"attachment_content_type":"image/png","attachment_file_name":"ror_baseball_jersey_back_blue.png","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:31Z","attachment_width":240,"attachment_height":240,"alt":null,"viewable_type":"Spree::Variant","viewable_id":18,"attachment_url":"/spree/products/4/product/ror_baseball_jersey_back_blue.png?1371010171"}]},{"id":19,"name":"Ruby on Rails Baseball Jersey","sku":"ROR-00003","price":"19.99","weight":null,"height":null,"width":null,"depth":null,"is_master":false,"cost_price":"17.0","permalink":"ruby-on-rails-baseball-jersey","count_on_hand":10,"option_values":[{"id":15,"name":"Small","presentation":"S","option_type_name":"tshirt-size","option_type_id":1},{"id":41,"name":"Green","presentation":"Green","option_type_name":"tshirt-color","option_type_id":2}],"images":[{"id":5,"position":1,"attachment_content_type":"image/png","attachment_file_name":"ror_baseball_jersey_green.png","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:32Z","attachment_width":240,"attachment_height":240,"alt":null,"viewable_type":"Spree::Variant","viewable_id":19,"attachment_url":"/spree/products/5/product/ror_baseball_jersey_green.png?1371010172"},{"id":6,"position":2,"attachment_content_type":"image/png","attachment_file_name":"ror_baseball_jersey_back_green.png","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:33Z","attachment_width":240,"attachment_height":240,"alt":null,"viewable_type":"Spree::Variant","viewable_id":19,"attachment_url":"/spree/products/6/product/ror_baseball_jersey_back_green.png?1371010173"}]},{"id":20,"name":"Ruby on Rails Baseball Jersey","sku":"ROR-00004","price":"19.99","weight":null,"height":null,"width":null,"depth":null,"is_master":false,"cost_price":"17.0","permalink":"ruby-on-rails-baseball-jersey","count_on_hand":10,"option_values":[{"id":30,"name":"Medium","presentation":"M","option_type_name":"tshirt-size","option_type_id":1},{"id":40,"name":"Red","presentation":"Red","option_type_name":"tshirt-color","option_type_id":2}],"images":[{"id":7,"position":1,"attachment_content_type":"image/png","attachment_file_name":"ror_baseball_jersey_red.png","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:34Z","attachment_width":240,"attachment_height":240,"alt":null,"viewable_type":"Spree::Variant","viewable_id":20,"attachment_url":"/spree/products/7/product/ror_baseball_jersey_red.png?1371010174"},{"id":8,"position":2,"attachment_content_type":"image/png","attachment_file_name":"ror_baseball_jersey_back_red.png","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:34Z","attachment_width":240,"attachment_height":240,"alt":null,"viewable_type":"Spree::Variant","viewable_id":20,"attachment_url":"/spree/products/8/product/ror_baseball_jersey_back_red.png?1371010174"}]},{"id":21,"name":"Ruby on Rails Baseball Jersey","sku":"ROR-00005","price":"19.99","weight":null,"height":null,"width":null,"depth":null,"is_master":false,"cost_price":"17.0","permalink":"ruby-on-rails-baseball-jersey","count_on_hand":10,"option_values":[{"id":30,"name":"Medium","presentation":"M","option_type_name":"tshirt-size","option_type_id":1},{"id":7,"name":"Blue","presentation":"Blue","option_type_name":"tshirt-color","option_type_id":2}],"images":[{"id":9,"position":1,"attachment_content_type":"image/png","attachment_file_name":"ror_baseball_jersey_blue.png","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:35Z","attachment_width":240,"attachment_height":240,"alt":null,"viewable_type":"Spree::Variant","viewable_id":21,"attachment_url":"/spree/products/9/product/ror_baseball_jersey_blue.png?1371010175"},{"id":10,"position":2,"attachment_content_type":"image/png","attachment_file_name":"ror_baseball_jersey_back_blue.png","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:36Z","attachment_width":240,"attachment_height":240,"alt":null,"viewable_type":"Spree::Variant","viewable_id":21,"attachment_url":"/spree/products/10/product/ror_baseball_jersey_back_blue.png?1371010176"}]},{"id":22,"name":"Ruby on Rails Baseball Jersey","sku":"ROR-00006","price":"19.99","weight":null,"height":null,"width":null,"depth":null,"is_master":false,"cost_price":"17.0","permalink":"ruby-on-rails-baseball-jersey","count_on_hand":10,"option_values":[{"id":30,"name":"Medium","presentation":"M","option_type_name":"tshirt-size","option_type_id":1},{"id":41,"name":"Green","presentation":"Green","option_type_name":"tshirt-color","option_type_id":2}],"images":[{"id":11,"position":1,"attachment_content_type":"image/png","attachment_file_name":"ror_baseball_jersey_green.png","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:37Z","attachment_width":240,"attachment_height":240,"alt":null,"viewable_type":"Spree::Variant","viewable_id":22,"attachment_url":"/spree/products/11/product/ror_baseball_jersey_green.png?1371010177"},{"id":12,"position":2,"attachment_content_type":"image/png","attachment_file_name":"ror_baseball_jersey_back_green.png","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:37Z","attachment_width":240,"attachment_height":240,"alt":null,"viewable_type":"Spree::Variant","viewable_id":22,"attachment_url":"/spree/products/12/product/ror_baseball_jersey_back_green.png?1371010177"}]},{"id":23,"name":"Ruby on Rails Baseball Jersey","sku":"ROR-00007","price":"19.99","weight":null,"height":null,"width":null,"depth":null,"is_master":false,"cost_price":"17.0","permalink":"ruby-on-rails-baseball-jersey","count_on_hand":10,"option_values":[{"id":31,"name":"Large","presentation":"L","option_type_name":"tshirt-size","option_type_id":1},{"id":40,"name":"Red","presentation":"Red","option_type_name":"tshirt-color","option_type_id":2}],"images":[{"id":13,"position":1,"attachment_content_type":"image/png","attachment_file_name":"ror_baseball_jersey_red.png","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:38Z","attachment_width":240,"attachment_height":240,"alt":null,"viewable_type":"Spree::Variant","viewable_id":23,"attachment_url":"/spree/products/13/product/ror_baseball_jersey_red.png?1371010178"},{"id":14,"position":2,"attachment_content_type":"image/png","attachment_file_name":"ror_baseball_jersey_back_red.png","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:39Z","attachment_width":240,"attachment_height":240,"alt":null,"viewable_type":"Spree::Variant","viewable_id":23,"attachment_url":"/spree/products/14/product/ror_baseball_jersey_back_red.png?1371010179"}]},{"id":24,"name":"Ruby on Rails Baseball Jersey","sku":"ROR-00008","price":"19.99","weight":null,"height":null,"width":null,"depth":null,"is_master":false,"cost_price":"17.0","permalink":"ruby-on-rails-baseball-jersey","count_on_hand":10,"option_values":[{"id":31,"name":"Large","presentation":"L","option_type_name":"tshirt-size","option_type_id":1},{"id":7,"name":"Blue","presentation":"Blue","option_type_name":"tshirt-color","option_type_id":2}],"images":[{"id":15,"position":1,"attachment_content_type":"image/png","attachment_file_name":"ror_baseball_jersey_blue.png","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:40Z","attachment_width":240,"attachment_height":240,"alt":null,"viewable_type":"Spree::Variant","viewable_id":24,"attachment_url":"/spree/products/15/product/ror_baseball_jersey_blue.png?1371010180"},{"id":16,"position":2,"attachment_content_type":"image/png","attachment_file_name":"ror_baseball_jersey_back_blue.png","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:40Z","attachment_width":240,"attachment_height":240,"alt":null,"viewable_type":"Spree::Variant","viewable_id":24,"attachment_url":"/spree/products/16/product/ror_baseball_jersey_back_blue.png?1371010180"}]},{"id":25,"name":"Ruby on Rails Baseball Jersey","sku":"ROR-00009","price":"19.99","weight":null,"height":null,"width":null,"depth":null,"is_master":false,"cost_price":"17.0","permalink":"ruby-on-rails-baseball-jersey","count_on_hand":10,"option_values":[{"id":31,"name":"Large","presentation":"L","option_type_name":"tshirt-size","option_type_id":1},{"id":41,"name":"Green","presentation":"Green","option_type_name":"tshirt-color","option_type_id":2}],"images":[{"id":17,"position":1,"attachment_content_type":"image/png","attachment_file_name":"ror_baseball_jersey_green.png","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:41Z","attachment_width":240,"attachment_height":240,"alt":null,"viewable_type":"Spree::Variant","viewable_id":25,"attachment_url":"/spree/products/17/product/ror_baseball_jersey_green.png?1371010181"},{"id":18,"position":2,"attachment_content_type":"image/png","attachment_file_name":"ror_baseball_jersey_back_green.png","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:42Z","attachment_width":240,"attachment_height":240,"alt":null,"viewable_type":"Spree::Variant","viewable_id":25,"attachment_url":"/spree/products/18/product/ror_baseball_jersey_back_green.png?1371010182"}]},{"id":26,"name":"Ruby on Rails Baseball Jersey","sku":"ROR-00012","price":"19.99","weight":null,"height":null,"width":null,"depth":null,"is_master":false,"cost_price":"17.0","permalink":"ruby-on-rails-baseball-jersey","count_on_hand":10,"option_values":[{"id":4,"name":"Extra Large","presentation":"XL","option_type_name":"tshirt-size","option_type_id":1},{"id":41,"name":"Green","presentation":"Green","option_type_name":"tshirt-color","option_type_id":2}],"images":[{"id":19,"position":1,"attachment_content_type":"image/png","attachment_file_name":"ror_baseball_jersey_green.png","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:43Z","attachment_width":240,"attachment_height":240,"alt":null,"viewable_type":"Spree::Variant","viewable_id":26,"attachment_url":"/spree/products/19/product/ror_baseball_jersey_green.png?1371010183"},{"id":20,"position":2,"attachment_content_type":"image/png","attachment_file_name":"ror_baseball_jersey_back_green.png","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:43Z","attachment_width":240,"attachment_height":240,"alt":null,"viewable_type":"Spree::Variant","viewable_id":26,"attachment_url":"/spree/products/20/product/ror_baseball_jersey_back_green.png?1371010183"}]},{"id":3,"name":"Ruby on Rails Baseball Jersey","sku":"ROR-001","price":"19.99","weight":null,"height":null,"width":null,"depth":null,"is_master":true,"cost_price":"17.0","permalink":"ruby-on-rails-baseball-jersey","count_on_hand":10,"option_values":[],"images":[{"id":24,"position":1,"attachment_content_type":"image/jpeg","attachment_file_name":"ror_baseball.jpeg","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:47Z","attachment_width":360,"attachment_height":360,"alt":null,"viewable_type":"Spree::Variant","viewable_id":3,"attachment_url":"/spree/products/24/product/ror_baseball.jpeg?1371010187"},{"id":25,"position":2,"attachment_content_type":"image/jpeg","attachment_file_name":"ror_baseball_back.jpeg","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:48Z","attachment_width":360,"attachment_height":360,"alt":null,"viewable_type":"Spree::Variant","viewable_id":3,"attachment_url":"/spree/products/25/product/ror_baseball_back.jpeg?1371010188"}]}],"option_types":[{"id":1,"name":"tshirt-size","presentation":"Size","position":1,"option_values":[{"id":43,"name":"Small","presentation":"S","option_type_name":"tshirt-size","option_type_id":1},{"id":44,"name":"Medium","presentation":"M","option_type_name":"tshirt-size","option_type_id":1},{"id":45,"name":"Large","presentation":"L","option_type_name":"tshirt-size","option_type_id":1},{"id":46,"name":"Extra Large","presentation":"XL","option_type_name":"tshirt-size","option_type_id":1},{"id":36,"name":"Small","presentation":"S","option_type_name":"tshirt-size","option_type_id":1},{"id":37,"name":"Medium","presentation":"M","option_type_name":"tshirt-size","option_type_id":1},{"id":38,"name":"Large","presentation":"L","option_type_name":"tshirt-size","option_type_id":1},{"id":39,"name":"Extra Large","presentation":"XL","option_type_name":"tshirt-size","option_type_id":1},{"id":29,"name":"Small","presentation":"S","option_type_name":"tshirt-size","option_type_id":1},{"id":30,"name":"Medium","presentation":"M","option_type_name":"tshirt-size","option_type_id":1},{"id":31,"name":"Large","presentation":"L","option_type_name":"tshirt-size","option_type_id":1},{"id":32,"name":"Extra Large","presentation":"XL","option_type_name":"tshirt-size","option_type_id":1},{"id":22,"name":"Small","presentation":"S","option_type_name":"tshirt-size","option_type_id":1},{"id":23,"name":"Medium","presentation":"M","option_type_name":"tshirt-size","option_type_id":1},{"id":24,"name":"Large","presentation":"L","option_type_name":"tshirt-size","option_type_id":1},{"id":25,"name":"Extra Large","presentation":"XL","option_type_name":"tshirt-size","option_type_id":1},{"id":15,"name":"Small","presentation":"S","option_type_name":"tshirt-size","option_type_id":1},{"id":16,"name":"Medium","presentation":"M","option_type_name":"tshirt-size","option_type_id":1},{"id":17,"name":"Large","presentation":"L","option_type_name":"tshirt-size","option_type_id":1},{"id":18,"name":"Extra Large","presentation":"XL","option_type_name":"tshirt-size","option_type_id":1},{"id":8,"name":"Small","presentation":"S","option_type_name":"tshirt-size","option_type_id":1},{"id":9,"name":"Medium","presentation":"M","option_type_name":"tshirt-size","option_type_id":1},{"id":10,"name":"Large","presentation":"L","option_type_name":"tshirt-size","option_type_id":1},{"id":11,"name":"Extra Large","presentation":"XL","option_type_name":"tshirt-size","option_type_id":1},{"id":1,"name":"Small","presentation":"S","option_type_name":"tshirt-size","option_type_id":1},{"id":2,"name":"Medium","presentation":"M","option_type_name":"tshirt-size","option_type_id":1},{"id":3,"name":"Large","presentation":"L","option_type_name":"tshirt-size","option_type_id":1},{"id":4,"name":"Extra Large","presentation":"XL","option_type_name":"tshirt-size","option_type_id":1}]},{"id":2,"name":"tshirt-color","presentation":"Color","position":2,"option_values":[{"id":47,"name":"Red","presentation":"Red","option_type_name":"tshirt-color","option_type_id":2},{"id":48,"name":"Green","presentation":"Green","option_type_name":"tshirt-color","option_type_id":2},{"id":49,"name":"Blue","presentation":"Blue","option_type_name":"tshirt-color","option_type_id":2},{"id":40,"name":"Red","presentation":"Red","option_type_name":"tshirt-color","option_type_id":2},{"id":41,"name":"Green","presentation":"Green","option_type_name":"tshirt-color","option_type_id":2},{"id":42,"name":"Blue","presentation":"Blue","option_type_name":"tshirt-color","option_type_id":2},{"id":33,"name":"Red","presentation":"Red","option_type_name":"tshirt-color","option_type_id":2},{"id":34,"name":"Green","presentation":"Green","option_type_name":"tshirt-color","option_type_id":2},{"id":35,"name":"Blue","presentation":"Blue","option_type_name":"tshirt-color","option_type_id":2},{"id":26,"name":"Red","presentation":"Red","option_type_name":"tshirt-color","option_type_id":2},{"id":27,"name":"Green","presentation":"Green","option_type_name":"tshirt-color","option_type_id":2},{"id":28,"name":"Blue","presentation":"Blue","option_type_name":"tshirt-color","option_type_id":2},{"id":19,"name":"Red","presentation":"Red","option_type_name":"tshirt-color","option_type_id":2},{"id":20,"name":"Green","presentation":"Green","option_type_name":"tshirt-color","option_type_id":2},{"id":21,"name":"Blue","presentation":"Blue","option_type_name":"tshirt-color","option_type_id":2},{"id":12,"name":"Red","presentation":"Red","option_type_name":"tshirt-color","option_type_id":2},{"id":13,"name":"Green","presentation":"Green","option_type_name":"tshirt-color","option_type_id":2},{"id":14,"name":"Blue","presentation":"Blue","option_type_name":"tshirt-color","option_type_id":2},{"id":5,"name":"Red","presentation":"Red","option_type_name":"tshirt-color","option_type_id":2},{"id":6,"name":"Green","presentation":"Green","option_type_name":"tshirt-color","option_type_id":2},{"id":7,"name":"Blue","presentation":"Blue","option_type_name":"tshirt-color","option_type_id":2}]}],"product_properties":[{"id":1,"product_id":3,"property_id":1,"value":"Wilson","property_name":"Manufacturer"},{"id":2,"product_id":3,"property_id":2,"value":"Wannabe Sports","property_name":"Brand"},{"id":3,"product_id":3,"property_id":3,"value":"JK1002","property_name":"Model"},{"id":4,"product_id":3,"property_id":4,"value":"Baseball Jersey","property_name":"Shirt Type"},{"id":5,"product_id":3,"property_id":5,"value":"Long","property_name":"Sleeve Type"},{"id":6,"product_id":3,"property_id":6,"value":"100% cotton","property_name":"Made from"},{"id":7,"product_id":3,"property_id":7,"value":"Loose","property_name":"Fit"},{"id":8,"product_id":3,"property_id":8,"value":"Men's","property_name":"Gender"}],"reviews":[],"related_products":[]},{"id":4,"name":"Ruby on Rails Jr. Spaghetti","description":"Molestias alias sed debitis labore optio. Veniam in exercitationem eaque aut. Quas deleniti omnis et vel cupiditate.","price":"19.99","available_on":"2013-06-12T04:09:25Z","permalink":"ruby-on-rails-jr-spaghetti","meta_description":null,"meta_keywords":null,"taxon_ids":[7],"variants":[{"id":4,"name":"Ruby on Rails Jr. Spaghetti","sku":"ROR-00013","price":"19.99","weight":null,"height":null,"width":null,"depth":null,"is_master":true,"cost_price":"17.0","permalink":"ruby-on-rails-jr-spaghetti","count_on_hand":10,"option_values":[],"images":[{"id":26,"position":1,"attachment_content_type":"image/jpeg","attachment_file_name":"ror_jr_spaghetti.jpeg","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:49Z","attachment_width":360,"attachment_height":360,"alt":null,"viewable_type":"Spree::Variant","viewable_id":4,"attachment_url":"/spree/products/26/product/ror_jr_spaghetti.jpeg?1371010189"}]}],"option_types":[],"product_properties":[{"id":9,"product_id":4,"property_id":1,"value":"Jerseys","property_name":"Manufacturer"},{"id":10,"product_id":4,"property_id":2,"value":"Resiliance","property_name":"Brand"},{"id":11,"product_id":4,"property_id":3,"value":"TL174","property_name":"Model"},{"id":12,"product_id":4,"property_id":4,"value":"Jr. Spaghetti T","property_name":"Shirt Type"},{"id":13,"product_id":4,"property_id":5,"value":"None","property_name":"Sleeve Type"},{"id":14,"product_id":4,"property_id":6,"value":"90% Cotton, 10% Nylon","property_name":"Made from"},{"id":15,"product_id":4,"property_id":7,"value":"Form","property_name":"Fit"},{"id":16,"product_id":4,"property_id":8,"value":"Women's","property_name":"Gender"}],"reviews":[],"related_products":[]},{"id":5,"name":"Ruby on Rails Ringer T-Shirt","description":"Molestias alias sed debitis labore optio. Veniam in exercitationem eaque aut. Quas deleniti omnis et vel cupiditate.","price":"19.99","available_on":"2013-06-12T04:09:25Z","permalink":"ruby-on-rails-ringer-t-shirt","meta_description":null,"meta_keywords":null,"taxon_ids":[8],"variants":[{"id":5,"name":"Ruby on Rails Ringer T-Shirt","sku":"ROR-00015","price":"19.99","weight":null,"height":null,"width":null,"depth":null,"is_master":true,"cost_price":"17.0","permalink":"ruby-on-rails-ringer-t-shirt","count_on_hand":10,"option_values":[],"images":[{"id":29,"position":1,"attachment_content_type":"image/jpeg","attachment_file_name":"ror_ringer.jpeg","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:51Z","attachment_width":360,"attachment_height":360,"alt":null,"viewable_type":"Spree::Variant","viewable_id":5,"attachment_url":"/spree/products/29/product/ror_ringer.jpeg?1371010191"},{"id":30,"position":2,"attachment_content_type":"image/jpeg","attachment_file_name":"ror_ringer_back.jpeg","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:52Z","attachment_width":360,"attachment_height":360,"alt":null,"viewable_type":"Spree::Variant","viewable_id":5,"attachment_url":"/spree/products/30/product/ror_ringer_back.jpeg?1371010192"}]}],"option_types":[],"product_properties":[{"id":17,"product_id":5,"property_id":1,"value":"Jerseys","property_name":"Manufacturer"},{"id":18,"product_id":5,"property_id":2,"value":"Conditioned","property_name":"Brand"},{"id":19,"product_id":5,"property_id":3,"value":"TL9002","property_name":"Model"},{"id":20,"product_id":5,"property_id":4,"value":"Ringer T","property_name":"Shirt Type"},{"id":21,"product_id":5,"property_id":5,"value":"Short","property_name":"Sleeve Type"},{"id":22,"product_id":5,"property_id":6,"value":"100% Vellum","property_name":"Made from"},{"id":23,"product_id":5,"property_id":7,"value":"Loose","property_name":"Fit"},{"id":24,"product_id":5,"property_id":8,"value":"Men's","property_name":"Gender"}],"reviews":[],"related_products":[]},{"id":6,"name":"Ruby Baseball Jersey","description":"Molestias alias sed debitis labore optio. Veniam in exercitationem eaque aut. Quas deleniti omnis et vel cupiditate.","price":"19.99","available_on":"2013-06-12T04:09:25Z","permalink":"ruby-baseball-jersey","meta_description":null,"meta_keywords":null,"taxon_ids":[8],"variants":[{"id":6,"name":"Ruby Baseball Jersey","sku":"RUB-00001","price":"19.99","weight":null,"height":null,"width":null,"depth":null,"is_master":true,"cost_price":"17.0","permalink":"ruby-baseball-jersey","count_on_hand":10,"option_values":[],"images":[{"id":34,"position":1,"attachment_content_type":"image/png","attachment_file_name":"ruby_baseball.png","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:55Z","attachment_width":495,"attachment_height":477,"alt":null,"viewable_type":"Spree::Variant","viewable_id":6,"attachment_url":"/spree/products/34/product/ruby_baseball.png?1371010195"}]}],"option_types":[],"product_properties":[],"reviews":[],"related_products":[]},{"id":7,"name":"Apache Baseball Jersey","description":"Molestias alias sed debitis labore optio. Veniam in exercitationem eaque aut. Quas deleniti omnis et vel cupiditate.","price":"19.99","available_on":"2013-06-12T04:09:25Z","permalink":"apache-baseball-jersey","meta_description":null,"meta_keywords":null,"taxon_ids":[8],"variants":[{"id":7,"name":"Apache Baseball Jersey","sku":"APC-00001","price":"19.99","weight":null,"height":null,"width":null,"depth":null,"is_master":true,"cost_price":"17.0","permalink":"apache-baseball-jersey","count_on_hand":10,"option_values":[],"images":[{"id":33,"position":1,"attachment_content_type":"image/png","attachment_file_name":"apache_baseball.png","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:54Z","attachment_width":504,"attachment_height":484,"alt":null,"viewable_type":"Spree::Variant","viewable_id":7,"attachment_url":"/spree/products/33/product/apache_baseball.png?1371010194"}]}],"option_types":[],"product_properties":[],"reviews":[],"related_products":[]},{"id":8,"name":"Spree Baseball Jersey","description":"Molestias alias sed debitis labore optio. Veniam in exercitationem eaque aut. Quas deleniti omnis et vel cupiditate.","price":"19.99","available_on":"2013-06-12T04:09:25Z","permalink":"spree-baseball-jersey","meta_description":null,"meta_keywords":null,"taxon_ids":[8],"variants":[{"id":8,"name":"Spree Baseball Jersey","sku":"SPR-00001","price":"19.99","weight":null,"height":null,"width":null,"depth":null,"is_master":true,"cost_price":"17.0","permalink":"spree-baseball-jersey","count_on_hand":10,"option_values":[],"images":[{"id":41,"position":1,"attachment_content_type":"image/jpeg","attachment_file_name":"spree_jersey.jpeg","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:10:01Z","attachment_width":480,"attachment_height":480,"alt":null,"viewable_type":"Spree::Variant","viewable_id":8,"attachment_url":"/spree/products/41/product/spree_jersey.jpeg?1371010201"},{"id":42,"position":2,"attachment_content_type":"image/jpeg","attachment_file_name":"spree_jersey_back.jpeg","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:10:01Z","attachment_width":480,"attachment_height":480,"alt":null,"viewable_type":"Spree::Variant","viewable_id":8,"attachment_url":"/spree/products/42/product/spree_jersey_back.jpeg?1371010201"}]}],"option_types":[{"id":1,"name":"tshirt-size","presentation":"Size","position":1,"option_values":[{"id":43,"name":"Small","presentation":"S","option_type_name":"tshirt-size","option_type_id":1},{"id":44,"name":"Medium","presentation":"M","option_type_name":"tshirt-size","option_type_id":1},{"id":45,"name":"Large","presentation":"L","option_type_name":"tshirt-size","option_type_id":1},{"id":46,"name":"Extra Large","presentation":"XL","option_type_name":"tshirt-size","option_type_id":1},{"id":36,"name":"Small","presentation":"S","option_type_name":"tshirt-size","option_type_id":1},{"id":37,"name":"Medium","presentation":"M","option_type_name":"tshirt-size","option_type_id":1},{"id":38,"name":"Large","presentation":"L","option_type_name":"tshirt-size","option_type_id":1},{"id":39,"name":"Extra Large","presentation":"XL","option_type_name":"tshirt-size","option_type_id":1},{"id":29,"name":"Small","presentation":"S","option_type_name":"tshirt-size","option_type_id":1},{"id":30,"name":"Medium","presentation":"M","option_type_name":"tshirt-size","option_type_id":1},{"id":31,"name":"Large","presentation":"L","option_type_name":"tshirt-size","option_type_id":1},{"id":32,"name":"Extra Large","presentation":"XL","option_type_name":"tshirt-size","option_type_id":1},{"id":22,"name":"Small","presentation":"S","option_type_name":"tshirt-size","option_type_id":1},{"id":23,"name":"Medium","presentation":"M","option_type_name":"tshirt-size","option_type_id":1},{"id":24,"name":"Large","presentation":"L","option_type_name":"tshirt-size","option_type_id":1},{"id":25,"name":"Extra Large","presentation":"XL","option_type_name":"tshirt-size","option_type_id":1},{"id":15,"name":"Small","presentation":"S","option_type_name":"tshirt-size","option_type_id":1},{"id":16,"name":"Medium","presentation":"M","option_type_name":"tshirt-size","option_type_id":1},{"id":17,"name":"Large","presentation":"L","option_type_name":"tshirt-size","option_type_id":1},{"id":18,"name":"Extra Large","presentation":"XL","option_type_name":"tshirt-size","option_type_id":1},{"id":8,"name":"Small","presentation":"S","option_type_name":"tshirt-size","option_type_id":1},{"id":9,"name":"Medium","presentation":"M","option_type_name":"tshirt-size","option_type_id":1},{"id":10,"name":"Large","presentation":"L","option_type_name":"tshirt-size","option_type_id":1},{"id":11,"name":"Extra Large","presentation":"XL","option_type_name":"tshirt-size","option_type_id":1},{"id":1,"name":"Small","presentation":"S","option_type_name":"tshirt-size","option_type_id":1},{"id":2,"name":"Medium","presentation":"M","option_type_name":"tshirt-size","option_type_id":1},{"id":3,"name":"Large","presentation":"L","option_type_name":"tshirt-size","option_type_id":1},{"id":4,"name":"Extra Large","presentation":"XL","option_type_name":"tshirt-size","option_type_id":1}]},{"id":2,"name":"tshirt-color","presentation":"Color","position":2,"option_values":[{"id":47,"name":"Red","presentation":"Red","option_type_name":"tshirt-color","option_type_id":2},{"id":48,"name":"Green","presentation":"Green","option_type_name":"tshirt-color","option_type_id":2},{"id":49,"name":"Blue","presentation":"Blue","option_type_name":"tshirt-color","option_type_id":2},{"id":40,"name":"Red","presentation":"Red","option_type_name":"tshirt-color","option_type_id":2},{"id":41,"name":"Green","presentation":"Green","option_type_name":"tshirt-color","option_type_id":2},{"id":42,"name":"Blue","presentation":"Blue","option_type_name":"tshirt-color","option_type_id":2},{"id":33,"name":"Red","presentation":"Red","option_type_name":"tshirt-color","option_type_id":2},{"id":34,"name":"Green","presentation":"Green","option_type_name":"tshirt-color","option_type_id":2},{"id":35,"name":"Blue","presentation":"Blue","option_type_name":"tshirt-color","option_type_id":2},{"id":26,"name":"Red","presentation":"Red","option_type_name":"tshirt-color","option_type_id":2},{"id":27,"name":"Green","presentation":"Green","option_type_name":"tshirt-color","option_type_id":2},{"id":28,"name":"Blue","presentation":"Blue","option_type_name":"tshirt-color","option_type_id":2},{"id":19,"name":"Red","presentation":"Red","option_type_name":"tshirt-color","option_type_id":2},{"id":20,"name":"Green","presentation":"Green","option_type_name":"tshirt-color","option_type_id":2},{"id":21,"name":"Blue","presentation":"Blue","option_type_name":"tshirt-color","option_type_id":2},{"id":12,"name":"Red","presentation":"Red","option_type_name":"tshirt-color","option_type_id":2},{"id":13,"name":"Green","presentation":"Green","option_type_name":"tshirt-color","option_type_id":2},{"id":14,"name":"Blue","presentation":"Blue","option_type_name":"tshirt-color","option_type_id":2},{"id":5,"name":"Red","presentation":"Red","option_type_name":"tshirt-color","option_type_id":2},{"id":6,"name":"Green","presentation":"Green","option_type_name":"tshirt-color","option_type_id":2},{"id":7,"name":"Blue","presentation":"Blue","option_type_name":"tshirt-color","option_type_id":2}]}],"product_properties":[{"id":43,"product_id":8,"property_id":1,"value":"Wilson","property_name":"Manufacturer"},{"id":44,"product_id":8,"property_id":2,"value":"Wannabe Sports","property_name":"Brand"},{"id":45,"product_id":8,"property_id":3,"value":"JK1002","property_name":"Model"},{"id":46,"product_id":8,"property_id":4,"value":"Baseball Jersey","property_name":"Shirt Type"},{"id":47,"product_id":8,"property_id":5,"value":"Long","property_name":"Sleeve Type"},{"id":48,"product_id":8,"property_id":6,"value":"100% cotton","property_name":"Made from"},{"id":49,"product_id":8,"property_id":7,"value":"Loose","property_name":"Fit"},{"id":50,"product_id":8,"property_id":8,"value":"Men's","property_name":"Gender"}],"reviews":[],"related_products":[]},{"id":9,"name":"Spree Jr. Spaghetti","description":"Molestias alias sed debitis labore optio. Veniam in exercitationem eaque aut. Quas deleniti omnis et vel cupiditate.","price":"19.99","available_on":"2013-06-12T04:09:25Z","permalink":"spree-jr-spaghetti","meta_description":null,"meta_keywords":null,"taxon_ids":[7],"variants":[{"id":9,"name":"Spree Jr. Spaghetti","sku":"SPR-00013","price":"19.99","weight":null,"height":null,"width":null,"depth":null,"is_master":true,"cost_price":"17.0","permalink":"spree-jr-spaghetti","count_on_hand":10,"option_values":[],"images":[{"id":40,"position":1,"attachment_content_type":"image/jpeg","attachment_file_name":"spree_spaghetti.jpeg","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:10:00Z","attachment_width":480,"attachment_height":480,"alt":null,"viewable_type":"Spree::Variant","viewable_id":9,"attachment_url":"/spree/products/40/product/spree_spaghetti.jpeg?1371010200"}]}],"option_types":[],"product_properties":[{"id":51,"product_id":9,"property_id":1,"value":"Jerseys","property_name":"Manufacturer"},{"id":52,"product_id":9,"property_id":2,"value":"Resiliance","property_name":"Brand"},{"id":53,"product_id":9,"property_id":3,"value":"TL174","property_name":"Model"},{"id":54,"product_id":9,"property_id":4,"value":"Jr. Spaghetti T","property_name":"Shirt Type"},{"id":55,"product_id":9,"property_id":5,"value":"None","property_name":"Sleeve Type"},{"id":56,"product_id":9,"property_id":6,"value":"90% Cotton, 10% Nylon","property_name":"Made from"},{"id":57,"product_id":9,"property_id":7,"value":"Form","property_name":"Fit"},{"id":58,"product_id":9,"property_id":8,"value":"Women's","property_name":"Gender"}],"reviews":[],"related_products":[]},{"id":10,"name":"Spree Ringer T-Shirt","description":"Molestias alias sed debitis labore optio. Veniam in exercitationem eaque aut. Quas deleniti omnis et vel cupiditate.","price":"19.99","available_on":"2013-06-12T04:09:25Z","permalink":"spree-ringer-t-shirt","meta_description":null,"meta_keywords":null,"taxon_ids":[8],"variants":[{"id":10,"name":"Spree Ringer T-Shirt","sku":"SPR-00015","price":"19.99","weight":null,"height":null,"width":null,"depth":null,"is_master":true,"cost_price":"17.0","permalink":"spree-ringer-t-shirt","count_on_hand":10,"option_values":[],"images":[{"id":38,"position":1,"attachment_content_type":"image/jpeg","attachment_file_name":"spree_ringer_t.jpeg","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:58Z","attachment_width":480,"attachment_height":480,"alt":null,"viewable_type":"Spree::Variant","viewable_id":10,"attachment_url":"/spree/products/38/product/spree_ringer_t.jpeg?1371010198"},{"id":39,"position":2,"attachment_content_type":"image/jpeg","attachment_file_name":"spree_ringer_t_back.jpeg","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:59Z","attachment_width":480,"attachment_height":480,"alt":null,"viewable_type":"Spree::Variant","viewable_id":10,"attachment_url":"/spree/products/39/product/spree_ringer_t_back.jpeg?1371010199"}]}],"option_types":[],"product_properties":[{"id":59,"product_id":10,"property_id":1,"value":"Jerseys","property_name":"Manufacturer"},{"id":60,"product_id":10,"property_id":2,"value":"Conditioned","property_name":"Brand"},{"id":61,"product_id":10,"property_id":3,"value":"TL9002","property_name":"Model"},{"id":62,"product_id":10,"property_id":4,"value":"Ringer T","property_name":"Shirt Type"},{"id":63,"product_id":10,"property_id":5,"value":"Short","property_name":"Sleeve Type"},{"id":64,"product_id":10,"property_id":6,"value":"100% Vellum","property_name":"Made from"},{"id":65,"product_id":10,"property_id":7,"value":"Loose","property_name":"Fit"},{"id":66,"product_id":10,"property_id":8,"value":"Men's","property_name":"Gender"}],"reviews":[],"related_products":[]},{"id":11,"name":"Spree Tote","description":"Molestias alias sed debitis labore optio. Veniam in exercitationem eaque aut. Quas deleniti omnis et vel cupiditate.","price":"15.99","available_on":"2013-06-12T04:09:25Z","permalink":"spree-tote","meta_description":null,"meta_keywords":null,"taxon_ids":[4],"variants":[{"id":11,"name":"Spree Tote","sku":"SPR-00011","price":"15.99","weight":null,"height":null,"width":null,"depth":null,"is_master":true,"cost_price":"13.0","permalink":"spree-tote","count_on_hand":10,"option_values":[],"images":[{"id":36,"position":1,"attachment_content_type":"image/jpeg","attachment_file_name":"spree_tote_front.jpeg","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:57Z","attachment_width":480,"attachment_height":480,"alt":null,"viewable_type":"Spree::Variant","viewable_id":11,"attachment_url":"/spree/products/36/product/spree_tote_front.jpeg?1371010197"},{"id":37,"position":2,"attachment_content_type":"image/jpeg","attachment_file_name":"spree_tote_back.jpeg","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:57Z","attachment_width":480,"attachment_height":480,"alt":null,"viewable_type":"Spree::Variant","viewable_id":11,"attachment_url":"/spree/products/37/product/spree_tote_back.jpeg?1371010197"}]}],"option_types":[],"product_properties":[{"id":39,"product_id":11,"property_id":9,"value":"Tote","property_name":"Type"},{"id":40,"product_id":11,"property_id":10,"value":"15\" x 18\" x 6\"","property_name":"Size"}],"reviews":[],"related_products":[]},{"id":12,"name":"Spree Bag","description":"Molestias alias sed debitis labore optio. Veniam in exercitationem eaque aut. Quas deleniti omnis et vel cupiditate.","price":"22.99","available_on":"2013-06-12T04:09:25Z","permalink":"spree-bag","meta_description":null,"meta_keywords":null,"taxon_ids":[4],"variants":[{"id":12,"name":"Spree Bag","sku":"SPR-00012","price":"22.99","weight":null,"height":null,"width":null,"depth":null,"is_master":true,"cost_price":"21.0","permalink":"spree-bag","count_on_hand":10,"option_values":[],"images":[{"id":35,"position":1,"attachment_content_type":"image/jpeg","attachment_file_name":"spree_bag.jpeg","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:56Z","attachment_width":480,"attachment_height":480,"alt":null,"viewable_type":"Spree::Variant","viewable_id":12,"attachment_url":"/spree/products/35/product/spree_bag.jpeg?1371010196"}]}],"option_types":[],"product_properties":[{"id":41,"product_id":12,"property_id":9,"value":"Messenger","property_name":"Type"},{"id":42,"product_id":12,"property_id":10,"value":"14 1/2\" x 12\" x 5\"","property_name":"Size"}],"reviews":[],"related_products":[]},{"id":13,"name":"Ruby on Rails Mug","description":"Molestias alias sed debitis labore optio. Veniam in exercitationem eaque aut. Quas deleniti omnis et vel cupiditate.","price":"13.99","available_on":"2013-06-12T04:09:25Z","permalink":"ruby-on-rails-mug","meta_description":null,"meta_keywords":null,"taxon_ids":[5],"variants":[{"id":13,"name":"Ruby on Rails Mug","sku":"ROR-00014","price":"13.99","weight":null,"height":null,"width":null,"depth":null,"is_master":true,"cost_price":"11.0","permalink":"ruby-on-rails-mug","count_on_hand":10,"option_values":[],"images":[{"id":27,"position":1,"attachment_content_type":"image/jpeg","attachment_file_name":"ror_mug.jpeg","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:49Z","attachment_width":360,"attachment_height":360,"alt":null,"viewable_type":"Spree::Variant","viewable_id":13,"attachment_url":"/spree/products/27/product/ror_mug.jpeg?1371010189"},{"id":28,"position":2,"attachment_content_type":"image/jpeg","attachment_file_name":"ror_mug_back.jpeg","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:50Z","attachment_width":360,"attachment_height":360,"alt":null,"viewable_type":"Spree::Variant","viewable_id":13,"attachment_url":"/spree/products/28/product/ror_mug_back.jpeg?1371010190"}]}],"option_types":[],"product_properties":[{"id":31,"product_id":13,"property_id":9,"value":"Mug","property_name":"Type"},{"id":32,"product_id":13,"property_id":10,"value":"4.5\" tall, 3.25\" dia.","property_name":"Size"}],"reviews":[],"related_products":[]},{"id":14,"name":"Ruby on Rails Stein","description":"Molestias alias sed debitis labore optio. Veniam in exercitationem eaque aut. Quas deleniti omnis et vel cupiditate.","price":"16.99","available_on":"2013-06-12T04:09:25Z","permalink":"ruby-on-rails-stein","meta_description":null,"meta_keywords":null,"taxon_ids":[5],"variants":[{"id":14,"name":"Ruby on Rails Stein","sku":"ROR-00016","price":"16.99","weight":null,"height":null,"width":null,"depth":null,"is_master":true,"cost_price":"15.0","permalink":"ruby-on-rails-stein","count_on_hand":10,"option_values":[],"images":[{"id":31,"position":1,"attachment_content_type":"image/jpeg","attachment_file_name":"ror_stein.jpeg","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:52Z","attachment_width":360,"attachment_height":360,"alt":null,"viewable_type":"Spree::Variant","viewable_id":14,"attachment_url":"/spree/products/31/product/ror_stein.jpeg?1371010192"},{"id":32,"position":2,"attachment_content_type":"image/jpeg","attachment_file_name":"ror_stein_back.jpeg","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:09:53Z","attachment_width":360,"attachment_height":360,"alt":null,"viewable_type":"Spree::Variant","viewable_id":14,"attachment_url":"/spree/products/32/product/ror_stein_back.jpeg?1371010193"}]}],"option_types":[],"product_properties":[{"id":33,"product_id":14,"property_id":9,"value":"Stein","property_name":"Type"},{"id":34,"product_id":14,"property_id":10,"value":"6.75\" tall, 3.75\" dia. base, 3\" dia. rim","property_name":"Size"}],"reviews":[],"related_products":[]},{"id":15,"name":"Spree Stein","description":"Molestias alias sed debitis labore optio. Veniam in exercitationem eaque aut. Quas deleniti omnis et vel cupiditate.","price":"16.99","available_on":"2013-06-12T04:09:25Z","permalink":"spree-stein","meta_description":null,"meta_keywords":null,"taxon_ids":[5],"variants":[{"id":15,"name":"Spree Stein","sku":"SPR-00016","price":"16.99","weight":null,"height":null,"width":null,"depth":null,"is_master":true,"cost_price":"15.0","permalink":"spree-stein","count_on_hand":10,"option_values":[],"images":[{"id":43,"position":1,"attachment_content_type":"image/jpeg","attachment_file_name":"spree_stein.jpeg","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:10:02Z","attachment_width":480,"attachment_height":480,"alt":null,"viewable_type":"Spree::Variant","viewable_id":15,"attachment_url":"/spree/products/43/product/spree_stein.jpeg?1371010202"},{"id":44,"position":2,"attachment_content_type":"image/jpeg","attachment_file_name":"spree_stein_back.jpeg","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:10:03Z","attachment_width":480,"attachment_height":480,"alt":null,"viewable_type":"Spree::Variant","viewable_id":15,"attachment_url":"/spree/products/44/product/spree_stein_back.jpeg?1371010203"}]}],"option_types":[],"product_properties":[{"id":35,"product_id":15,"property_id":9,"value":"Stein","property_name":"Type"},{"id":36,"product_id":15,"property_id":10,"value":"6.75\" tall, 3.75\" dia. base, 3\" dia. rim","property_name":"Size"}],"reviews":[],"related_products":[]},{"id":16,"name":"Spree Mug","description":"Molestias alias sed debitis labore optio. Veniam in exercitationem eaque aut. Quas deleniti omnis et vel cupiditate.","price":"13.99","available_on":"2013-06-12T04:09:25Z","permalink":"spree-mug","meta_description":null,"meta_keywords":null,"taxon_ids":[5],"variants":[{"id":16,"name":"Spree Mug","sku":"SPR-00014","price":"13.99","weight":null,"height":null,"width":null,"depth":null,"is_master":true,"cost_price":"11.0","permalink":"spree-mug","count_on_hand":10,"option_values":[],"images":[{"id":45,"position":1,"attachment_content_type":"image/jpeg","attachment_file_name":"spree_mug.jpeg","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:10:04Z","attachment_width":240,"attachment_height":240,"alt":null,"viewable_type":"Spree::Variant","viewable_id":16,"attachment_url":"/spree/products/45/product/spree_mug.jpeg?1371010204"},{"id":46,"position":2,"attachment_content_type":"image/jpeg","attachment_file_name":"spree_mug_back.jpeg","type":"Spree::Image","attachment_updated_at":"2013-06-12T04:10:05Z","attachment_width":240,"attachment_height":240,"alt":null,"viewable_type":"Spree::Variant","viewable_id":16,"attachment_url":"/spree/products/46/product/spree_mug_back.jpeg?1371010205"}]}],"option_types":[],"product_properties":[{"id":37,"product_id":16,"property_id":9,"value":"Mug","property_name":"Type"},{"id":38,"product_id":16,"property_id":10,"value":"4.5\" tall, 3.25\" dia.","property_name":"Size"}],"reviews":[],"related_products":[{"id":15,"permalink":"spree-stein","name":"Spree Stein","image_url":"/spree/products/43/small/spree_stein.jpeg?1371010202"}]}]}