fulfillment-api 1.1.7 → 1.1.9

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
  SHA256:
3
- metadata.gz: f86d3a067fe30dcd56e08e12bd05d4a12a926899fdb0f44f9a3542d2772e87a2
4
- data.tar.gz: abb2fa42aec8a29bc6e0b7e741d5535d7cf76ea6074e011faed84f042795f894
3
+ metadata.gz: af35aee7889699e3f8011e79420e61565c96869d4c0fd66a54c9c8e96599c594
4
+ data.tar.gz: 3a6c00bb93c2f78a17352bfdab1eedc8288af82ee7491240756968a64f317d7e
5
5
  SHA512:
6
- metadata.gz: ff105f3acf96e2db4b003320e36d60136a7a600bb9fec90daf93e4d5c8e34a5f412ebfd004440ffd8b21ee60d83c85f3f5feaad2739bf99413289cd7393e9335
7
- data.tar.gz: c40043a01da7e6f606e041c1bb7a6c7a99da5bd78ef57dedf2d94dfa975689d030c079bf6c7099f77cd7d20344b6dc5e4d6241932399b7baefc3e10359661353
6
+ metadata.gz: 3adf3eb7b70bfd0960a582fbc33358c48bca6da8217993b6abffdf72c544de9ff20364f98a0d6497bd755ac86101e692b469324392131245c5226099d955e037
7
+ data.tar.gz: 3b3db9c3130083de6ba62ecfcce5e15d53e35bec45505f83d7bcfafce7a02c42df895c3e53fe5fdb92bf3e08f9b0281e0a7e993256993d88a9fcabae7b024422
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fulfillment-api (1.1.7)
4
+ fulfillment-api (1.1.9)
5
5
  activesupport (< 5.3)
6
6
  faraday (< 0.15)
7
7
  faraday_middleware (< 0.13)
@@ -3,9 +3,20 @@ module Fulfillment
3
3
  module Organizations
4
4
  extend self
5
5
 
6
- def find_all
7
- response = Request.new("organizations").get
8
- response.body
6
+ def find_all(params = {})
7
+ limit_to_type = params["type"]
8
+ request = "organizations"
9
+
10
+ if limit_to_type
11
+ request = ["types", limit_to_type, "organizations"].compact.join("/")
12
+ end
13
+
14
+ response = Request.new(request).get
15
+ output = response.body
16
+
17
+ output = reformat_ids_to_include_type(output, limit_to_type) if limit_to_type
18
+
19
+ output
9
20
  end
10
21
 
11
22
  def find(organization_id, type_name = nil)
@@ -21,6 +32,15 @@ module Fulfillment
21
32
  ).post
22
33
  response.body
23
34
  end
35
+
36
+ private
37
+
38
+ def reformat_ids_to_include_type(ids, type)
39
+ ids.each_with_object({}) do |id, obj|
40
+ obj[id] = [type]
41
+ obj
42
+ end
43
+ end
24
44
  end
25
45
  end
26
46
  end
@@ -1,5 +1,5 @@
1
1
  module Fulfillment
2
2
  module Api
3
- VERSION = "1.1.7"
3
+ VERSION = "1.1.9"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fulfillment-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ version: 1.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt White
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-06 00:00:00.000000000 Z
11
+ date: 2020-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug