evergreen_holdings 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/evergreen_holdings.rb +10 -1
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8dd3388514b1c9b46a0478dae03c6bbc8b96e496
4
- data.tar.gz: 6e1296f90b066155369b8578e91f6505e7d43a1f
3
+ metadata.gz: b06100edeee2a0a2ee6bc91b90295a015ef1a73a
4
+ data.tar.gz: 3fe988a6af5545933d9e16989e4bdf3a35f8ec42
5
5
  SHA512:
6
- metadata.gz: 7c5a4590219f7be4216794114f89405cb6badd6ec63710a469d33bd349b8d88d6eb22049c16c7883fb68a863ddb1125cbcfb0551ce1aca0a9dd80e20ca5bccf3
7
- data.tar.gz: 1ea5680f515e5ad9e862d0813ec86c7dd81cf87fd2705d2fe01cd13e2343cc798d439d3da82b28336bccc7f20965c6244dc99da5e30fd4026b78804134ba513e
6
+ metadata.gz: e14954516997254f54fe4c9c833ffca93003ea02691da279c88290a98cb0c4589faf7ac4c6aa3b377f90ef7106fe678b8e522c37e616bfdc5f54f54e71e47426
7
+ data.tar.gz: c3d372ae1d76b776dc792a0a7d9b0da2553d2fa24235346bae3106c0ba3af7e789492d330dc073e9717f0f4b5cf0e98a1448d64889b80d1a861d9ec08e69646b
@@ -25,7 +25,16 @@ module EvergreenHoldings
25
25
  # If you just want holdings at a specific org_unit: `my_connection.get_holdings 23405, org_unit: 5`
26
26
  def get_holdings tcn, options = {}
27
27
  if options.key?(:org_unit)
28
- params = "format=json&input_format=json&service=open-ils.cat&method=open-ils.cat.asset.copy_tree.retrieve&param=auth_token_not_needed_for_this_call&param=#{tcn}&param=#{options[:org_unit]}"
28
+ if options[:descendants]
29
+ params = "format=json&input_format=json&service=open-ils.cat&method=open-ils.cat.asset.copy_tree.retrieve&param=auth_token_not_needed_for_this_call&param=#{tcn}"
30
+ if @org_units[options[:org_unit]][:descendants]
31
+ @org_units[options[:org_unit]][:descendants].each do |ou|
32
+ params << + "&param=#{ou}"
33
+ end
34
+ end
35
+ else
36
+ params = "format=json&input_format=json&service=open-ils.cat&method=open-ils.cat.asset.copy_tree.retrieve&param=auth_token_not_needed_for_this_call&param=#{tcn}&param=#{options[:org_unit]}"
37
+ end
29
38
  else
30
39
  params = "format=json&input_format=json&service=open-ils.cat&method=open-ils.cat.asset.copy_tree.global.retrieve&param=auth_token_not_needed_for_this_call&param=#{tcn}"
31
40
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evergreen_holdings
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jane Sandberg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-18 00:00:00.000000000 Z
11
+ date: 2017-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest