fulfil-io 0.3.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 22ec67bfb2b90dbcdb4eef09efa189b25f11aada22ff2fa66d115b1c9cb26e06
4
- data.tar.gz: 48675559980e3ae07eb4a10938cfec33df858c82126faf2152a7a6c069cf3a79
3
+ metadata.gz: c4ad2709b85c238ad07608d510455eb6af65bbfb2b7bf1fe7a43bd42ec3327e8
4
+ data.tar.gz: 76d7e6189a7cc118eab1a3d4db1d10f7450a2ac96df50be1334abec7b877da7e
5
5
  SHA512:
6
- metadata.gz: c1ac80544c088e239f250f937c5b5f20c95ac818bbe394f3e55b4c32d9800301f534bb3a922885c55ba870bb10f5448612a0cc181c6cbef9e4cd91dfa035d4c7
7
- data.tar.gz: fbfb4ba1116956cdf9d3d2f2234fe53067ad31b9ffb87c36b62d01e1c3e1c31c84d7abfcbe29222b3aca58e097017bfd303f3903c1fc553d932ac55c44d64c1c
6
+ metadata.gz: 0b25ab906e005e6655a66db79f52a0edd4404a06a7a1ff1c90fea03eeb1e00e18c0e8a823e11ce45a2cf8a65ceb7c356882649d1cc3a586bc429eaedc1ec42f7
7
+ data.tar.gz: e7e965321b2e3aba9abd61add0c22dab1e81cc3ea3809f23ca164dcc46930ade6083bf3de243a23d53fae90b8bf08849041af40a808d41f1c27f1f750b575b32
@@ -1,3 +1,11 @@
1
+ ## 0.4.1
2
+
3
+ * @cdmwebs screwed up the release process, so this is a tiny bump to fix. No code changes.
4
+
5
+ ## 0.4.0
6
+
7
+ * Add `Client#count` and `Model#count`.
8
+
1
9
  ## 0.3.0
2
10
 
3
11
  * Add basic write support via `Fulfil::Client#post` and `Fulfil::Client#put`.
data/README.md CHANGED
@@ -68,6 +68,16 @@ pp sales
68
68
  # "rec_name"=>""}]
69
69
  ```
70
70
 
71
+ ### Count
72
+
73
+ ```ruby
74
+ client = Fulfil::Client.new
75
+ model = Fulfil::Model.new(client: client, model_name: 'stock.shipment.out')
76
+ model.count(domain: [['shipping_batch.state', '=', 'open']])
77
+
78
+ # Returns 7440
79
+ ```
80
+
71
81
  ### Writing
72
82
 
73
83
  As of v0.3.0, we've added very basic support for creates and updates via
@@ -52,6 +52,13 @@ module Fulfil
52
52
  parse(results: results)
53
53
  end
54
54
 
55
+ def count(model:, domain:)
56
+ uri = URI("#{model_url(model: model)}/search_count")
57
+ body = [domain]
58
+
59
+ request(verb: :put, endpoint: uri, json: body)
60
+ end
61
+
55
62
  def post(model:, body: {})
56
63
  uri = URI(model_url(model: model))
57
64
 
@@ -36,6 +36,10 @@ module Fulfil
36
36
  )
37
37
  end
38
38
 
39
+ def count(domain:)
40
+ @client.count(model: model_name, domain: domain)
41
+ end
42
+
39
43
  def all
40
44
  search(domain: query)
41
45
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Fulfil
4
- VERSION = '0.3.0'
4
+ VERSION = '0.4.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fulfil-io
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Moore