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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d1c32e08d744c892b9d92a54e71f26bc62a23185
4
- data.tar.gz: 507580e338eb5841a3382ce4b51a837d043cd6fa
3
+ metadata.gz: cffdb8805ddb9c8520c05e1665ab880af4b8be33
4
+ data.tar.gz: cb30f4f625cb55adceafc7fc137e618d85b39584
5
5
  SHA512:
6
- metadata.gz: 4583317f476204e923b9f4e749a712f66bcc2dfc67994c6a6c1b6d44dda0f01fc44c3ad60c2a55bfee8f3c1b8adfc170e6911a79043fe7034137e71cdf29533b
7
- data.tar.gz: 2c48c9b645c32ff10768e1ce1a4e25db9042d950963f52ee863ebc001894588a36251a7d971f56d0005c5089c688d8825070e1df523ff610f10faf3396454f8e
6
+ metadata.gz: 1036849e67deeacf2ec3af2a63a591e0af856b4ca49193e4c6b92684c96a980bcf00c270293b9b239f1b3bced247f0d8e96000b8abf4f19764fccd98a1a2720d
7
+ data.tar.gz: 55978d5d31964e062b147925ecc87146ea2564efb1d9262e134fb649415192981ec760f3f1ca1da0c4b2f4185f71d3b0b51bc2f3d583cf281d4389a14a428b93
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Nimbu
2
2
  module API
3
- VERSION = "0.2.beta.2"
3
+ VERSION = "0.2.beta.3"
4
4
  end
5
5
  end
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.2
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-08-07 00:00:00.000000000 Z
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