nimbu-api 0.2.beta.2 → 0.2.beta.3
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/client.rb +4 -0
- data/lib/nimbu-api/endpoints/customers.rb +44 -0
- data/lib/nimbu-api/version.rb +1 -1
- data/lib/nimbu-api.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cffdb8805ddb9c8520c05e1665ab880af4b8be33
|
4
|
+
data.tar.gz: cb30f4f625cb55adceafc7fc137e618d85b39584
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1036849e67deeacf2ec3af2a63a591e0af856b4ca49193e4c6b92684c96a980bcf00c270293b9b239f1b3bced247f0d8e96000b8abf4f19764fccd98a1a2720d
|
7
|
+
data.tar.gz: 55978d5d31964e062b147925ecc87146ea2564efb1d9262e134fb649415192981ec760f3f1ca1da0c4b2f4185f71d3b0b51bc2f3d583cf281d4389a14a428b93
|
data/lib/nimbu-api/client.rb
CHANGED
@@ -34,6 +34,10 @@ module Nimbu
|
|
34
34
|
Nimbu::Builder.new('Products', current_options.merge(options), &block)
|
35
35
|
end
|
36
36
|
|
37
|
+
def customers(options={}, &block)
|
38
|
+
Nimbu::Builder.new('Customers', current_options.merge(options), &block)
|
39
|
+
end
|
40
|
+
|
37
41
|
def collections(options={}, &block)
|
38
42
|
Nimbu::Builder.new('Collections', current_options.merge(options), &block)
|
39
43
|
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module Nimbu
|
4
|
+
module Endpoints
|
5
|
+
class Customers < Endpoint
|
6
|
+
def list(*args)
|
7
|
+
arguments(args)
|
8
|
+
|
9
|
+
response = get_request("/customers", 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 => [:customer_id])
|
17
|
+
|
18
|
+
get_request("/customers/#{customer_id}", arguments.params)
|
19
|
+
end
|
20
|
+
alias :find :get
|
21
|
+
|
22
|
+
def create(*args)
|
23
|
+
arguments(args)
|
24
|
+
|
25
|
+
post_request("/customers", arguments.params)
|
26
|
+
end
|
27
|
+
|
28
|
+
def update(*args)
|
29
|
+
arguments(args, :required => [:customer_id])
|
30
|
+
|
31
|
+
patch_request("/customers/#{customer_id}", arguments.params)
|
32
|
+
end
|
33
|
+
alias :edit :update
|
34
|
+
|
35
|
+
def delete(*args)
|
36
|
+
arguments(args, :required => [:customer_id])
|
37
|
+
|
38
|
+
delete_request("/customers/#{customer_id}", arguments.params)
|
39
|
+
end
|
40
|
+
alias :remove :delete
|
41
|
+
|
42
|
+
end # Customers
|
43
|
+
end # Endpoints
|
44
|
+
end # Nimbu
|
data/lib/nimbu-api/version.rb
CHANGED
data/lib/nimbu-api.rb
CHANGED
@@ -27,6 +27,7 @@ require 'nimbu-api/endpoints/themes/assets'
|
|
27
27
|
require 'nimbu-api/endpoints/channels'
|
28
28
|
require 'nimbu-api/endpoints/channels/entries'
|
29
29
|
require 'nimbu-api/endpoints/products'
|
30
|
+
require 'nimbu-api/endpoints/customers'
|
30
31
|
require 'nimbu-api/endpoints/collections'
|
31
32
|
require 'nimbu-api/endpoints/videos'
|
32
33
|
|
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.2.beta.
|
4
|
+
version: 0.2.beta.3
|
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-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|
@@ -188,6 +188,7 @@ files:
|
|
188
188
|
- lib/nimbu-api/endpoints/channels.rb
|
189
189
|
- lib/nimbu-api/endpoints/channels/entries.rb
|
190
190
|
- lib/nimbu-api/endpoints/collections.rb
|
191
|
+
- lib/nimbu-api/endpoints/customers.rb
|
191
192
|
- lib/nimbu-api/endpoints/login.rb
|
192
193
|
- lib/nimbu-api/endpoints/products.rb
|
193
194
|
- lib/nimbu-api/endpoints/simulator.rb
|