Skip to content

Commit

Permalink
Add Collect API.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kelsey Judson committed Mar 18, 2014
1 parent ae60976 commit 9c39ab0
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.gem
.pryrc.local
4 changes: 4 additions & 0 deletions .pryrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ $: << '../lucid_client/lib'

require 'lucid_client'
require 'lucid_shopify'

if File.exist?( f = '.pryrc.local' )
load f
end
1 change: 1 addition & 0 deletions lib/lucid_shopify.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module LucidShopify
require 'lucid_shopify/api/shop_api'
require 'lucid_shopify/api/collection_api'
require 'lucid_shopify/api/product_api'
require 'lucid_shopify/api/collect_api'
require 'lucid_shopify/api/webhook_api'

### Billing API
Expand Down
22 changes: 22 additions & 0 deletions lib/lucid_shopify/api/collect_api.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module LucidShopify
class CollectAPI

include LucidClient::API
include LucidShopify::PaginatedResource

def in_collection( collection_id )
all( :collection_id => collection_id )
end

private

def _model
LucidShopify.config[:collect_model]
end

def _resource
'collects'
end

end
end
2 changes: 1 addition & 1 deletion lib/lucid_shopify/api/product_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class ProductAPI
include LucidClient::API
include LucidShopify::PaginatedResource

def in_collection( collection_id )
def in_collection( collection_id, options = {} )
all( :collection_id => collection_id )
end

Expand Down
2 changes: 1 addition & 1 deletion lib/lucid_shopify/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module LucidShopify

VERSION = '0.0.0'
VERSION = '0.1.0'

end

0 comments on commit 9c39ab0

Please sign in to comment.