nimbu-api 0.1.5 → 0.2.beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/nimbu-api.rb +2 -0
- data/lib/nimbu-api/client.rb +8 -0
- data/lib/nimbu-api/endpoints/channels/entries.rb +1 -1
- data/lib/nimbu-api/endpoints/collections.rb +44 -0
- data/lib/nimbu-api/endpoints/products.rb +44 -0
- data/lib/nimbu-api/version.rb +1 -1
- data/nimbu-api.gemspec +0 -1
- metadata +6 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: efabf74795669664bbb5d20ccc7dd0ab62b4ef6a
|
4
|
+
data.tar.gz: 3070923e34f4cf81454169ef5944396fa004a713
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8382675ac82a9a3013bb59438b3f28d58999f4f4cf8675af425b6bfe158b6f62c20751a12db954fbf3df60788d64c94097dfebcd1793c7b4b67916527ed3ca1d
|
7
|
+
data.tar.gz: 297c3a2eb1887f42e13daf616c593928595e49d0df5f522ae44e1ed4654e65231e34f6ef82ba61b3ce61f23de81d2aae05478a29d60ecd497e7316325b79bb0b
|
data/lib/nimbu-api.rb
CHANGED
@@ -26,6 +26,8 @@ require 'nimbu-api/endpoints/themes/snippets'
|
|
26
26
|
require 'nimbu-api/endpoints/themes/assets'
|
27
27
|
require 'nimbu-api/endpoints/channels'
|
28
28
|
require 'nimbu-api/endpoints/channels/entries'
|
29
|
+
require 'nimbu-api/endpoints/products'
|
30
|
+
require 'nimbu-api/endpoints/collections'
|
29
31
|
require 'nimbu-api/endpoints/videos'
|
30
32
|
|
31
33
|
module Nimbu
|
data/lib/nimbu-api/client.rb
CHANGED
@@ -30,6 +30,14 @@ module Nimbu
|
|
30
30
|
Nimbu::Builder.new('Simulator', current_options.merge(options), &block)
|
31
31
|
end
|
32
32
|
|
33
|
+
def products(options={}, &block)
|
34
|
+
Nimbu::Builder.new('Products', current_options.merge(options), &block)
|
35
|
+
end
|
36
|
+
|
37
|
+
def collections(options={}, &block)
|
38
|
+
Nimbu::Builder.new('Collections', current_options.merge(options), &block)
|
39
|
+
end
|
40
|
+
|
33
41
|
def authenticate(options={}, &block)
|
34
42
|
Nimbu::Builder.new('Login', current_options.merge(options), &block).response
|
35
43
|
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module Nimbu
|
4
|
+
module Endpoints
|
5
|
+
class Collections < Endpoint
|
6
|
+
def list(*args)
|
7
|
+
arguments(args)
|
8
|
+
|
9
|
+
response = get_request("/collections", arguments.params)
|
10
|
+
return response unless block_given?
|
11
|
+
response.each { |el| yield el }
|
12
|
+
end
|
13
|
+
alias :all :list
|
14
|
+
|
15
|
+
def get(*args)
|
16
|
+
arguments(args, :required => :collection_id)
|
17
|
+
|
18
|
+
get_request("/collections/#{collection_id}", arguments.params)
|
19
|
+
end
|
20
|
+
alias :find :get
|
21
|
+
|
22
|
+
def create(*args)
|
23
|
+
arguments(args)
|
24
|
+
|
25
|
+
post_request("/collections/#{collection_id}", arguments.params)
|
26
|
+
end
|
27
|
+
|
28
|
+
def update(*args)
|
29
|
+
arguments(args, :required => :collection_id)
|
30
|
+
|
31
|
+
patch_request("/collections/#{collection_id}", arguments.params)
|
32
|
+
end
|
33
|
+
alias :edit :update
|
34
|
+
|
35
|
+
def delete(*args)
|
36
|
+
arguments(args, :required => :collection_id)
|
37
|
+
|
38
|
+
delete_request("/collections/#{collection_id}", arguments.params)
|
39
|
+
end
|
40
|
+
alias :remove :delete
|
41
|
+
|
42
|
+
end # Products
|
43
|
+
end # Endpoints
|
44
|
+
end # Nimbu
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module Nimbu
|
4
|
+
module Endpoints
|
5
|
+
class Products < Endpoint
|
6
|
+
def list(*args)
|
7
|
+
arguments(args)
|
8
|
+
|
9
|
+
response = get_request("/products", arguments.params)
|
10
|
+
return response unless block_given?
|
11
|
+
response.each { |el| yield el }
|
12
|
+
end
|
13
|
+
alias :all :list
|
14
|
+
|
15
|
+
def get(*args)
|
16
|
+
arguments(args, :required => :product_id)
|
17
|
+
|
18
|
+
get_request("/products/#{product_id}", arguments.params)
|
19
|
+
end
|
20
|
+
alias :find :get
|
21
|
+
|
22
|
+
def create(*args)
|
23
|
+
arguments(args)
|
24
|
+
|
25
|
+
post_request("/products/#{product_id}", arguments.params)
|
26
|
+
end
|
27
|
+
|
28
|
+
def update(*args)
|
29
|
+
arguments(args, :required => :product_id)
|
30
|
+
|
31
|
+
patch_request("/products/#{product_id}", arguments.params)
|
32
|
+
end
|
33
|
+
alias :edit :update
|
34
|
+
|
35
|
+
def delete(*args)
|
36
|
+
arguments(args, :required => :product_id)
|
37
|
+
|
38
|
+
delete_request("/products/#{product_id}", arguments.params)
|
39
|
+
end
|
40
|
+
alias :remove :delete
|
41
|
+
|
42
|
+
end # Products
|
43
|
+
end # Endpoints
|
44
|
+
end # Nimbu
|
data/lib/nimbu-api/version.rb
CHANGED
data/nimbu-api.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nimbu-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.beta
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Dedene
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|
@@ -164,20 +164,6 @@ dependencies:
|
|
164
164
|
- - '>='
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
|
-
- !ruby/object:Gem::Dependency
|
168
|
-
name: pry-debugger
|
169
|
-
requirement: !ruby/object:Gem::Requirement
|
170
|
-
requirements:
|
171
|
-
- - '>='
|
172
|
-
- !ruby/object:Gem::Version
|
173
|
-
version: '0'
|
174
|
-
type: :development
|
175
|
-
prerelease: false
|
176
|
-
version_requirements: !ruby/object:Gem::Requirement
|
177
|
-
requirements:
|
178
|
-
- - '>='
|
179
|
-
- !ruby/object:Gem::Version
|
180
|
-
version: '0'
|
181
167
|
description: Nimbu is the easiest way to build a beautiful multi-lingual online store!
|
182
168
|
See http://nimbu.io for more information.
|
183
169
|
email:
|
@@ -201,7 +187,9 @@ files:
|
|
201
187
|
- lib/nimbu-api/endpoints/authorizations.rb
|
202
188
|
- lib/nimbu-api/endpoints/channels.rb
|
203
189
|
- lib/nimbu-api/endpoints/channels/entries.rb
|
190
|
+
- lib/nimbu-api/endpoints/collections.rb
|
204
191
|
- lib/nimbu-api/endpoints/login.rb
|
192
|
+
- lib/nimbu-api/endpoints/products.rb
|
205
193
|
- lib/nimbu-api/endpoints/simulator.rb
|
206
194
|
- lib/nimbu-api/endpoints/sites.rb
|
207
195
|
- lib/nimbu-api/endpoints/themes.rb
|
@@ -277,9 +265,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
277
265
|
version: '0'
|
278
266
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
279
267
|
requirements:
|
280
|
-
- - '
|
268
|
+
- - '>'
|
281
269
|
- !ruby/object:Gem::Version
|
282
|
-
version:
|
270
|
+
version: 1.3.1
|
283
271
|
requirements: []
|
284
272
|
rubyforge_project:
|
285
273
|
rubygems_version: 2.0.3
|