storesapp-rb 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/base.rb +5 -3
- data/app/models/collection.rb +2 -2
- data/app/models/product.rb +2 -2
- metadata +4 -4
data/app/models/base.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
+
require 'yaml'
|
1
2
|
class Base < ActiveResource::Base
|
2
|
-
|
3
|
-
self.
|
4
|
-
self.
|
3
|
+
CONFIG = YAML::load(File.open(File.join(Rails.root, 'config', 'storesapp.yml')))[Rails.env]
|
4
|
+
self.site = ENV['STORESAPP_URL'] || CONFIG['url'] || "http://api.storesapp.com/v1"
|
5
|
+
self.user = ENV['STORESAPP_SUBDOMAIN'] || CONFIG['subdomain']
|
6
|
+
self.password = ENV['STORESAPP_API_KEY'] || CONFIG['api_key']
|
5
7
|
end
|
data/app/models/collection.rb
CHANGED
@@ -4,11 +4,11 @@ class Collection < Base
|
|
4
4
|
end
|
5
5
|
|
6
6
|
def add_product(options={})
|
7
|
-
post(:add_product, :product_id => options[:product_id])
|
7
|
+
# post(:add_product, :product_id => options[:product_id])
|
8
8
|
end
|
9
9
|
|
10
10
|
def remove_product(options={})
|
11
|
-
post(:remove_product, :product_id => options[:product_id])
|
11
|
+
# post(:remove_product, :product_id => options[:product_id])
|
12
12
|
end
|
13
13
|
|
14
14
|
def image
|
data/app/models/product.rb
CHANGED
@@ -16,10 +16,10 @@ class Product < Base
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def add_collection(options={})
|
19
|
-
post(:add_collection, :collection_id => options[:collection_id])
|
19
|
+
# post(:add_collection, :collection_id => options[:collection_id])
|
20
20
|
end
|
21
21
|
|
22
22
|
def remove_collection(options={})
|
23
|
-
post(:remove_collection, :collection_id => options[:collection_id])
|
23
|
+
# post(:remove_collection, :collection_id => options[:collection_id])
|
24
24
|
end
|
25
25
|
end
|
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:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 6
|
10
|
+
version: 0.2.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Next Feature
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-09-
|
19
|
+
date: 2010-09-21 00:00:00 -04:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|