ddr-aux-client 1.0.0.rc1 → 1.0.0.rc2

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
  SHA1:
3
- metadata.gz: 8a146d36612ec7c09f60ad2582f8e762f9e12612
4
- data.tar.gz: 2f4abcb0cf435adfa3ca399296573e8f98dc8e86
3
+ metadata.gz: 79a541eacdf4582c5f1334777a2ad9d61d54a9e2
4
+ data.tar.gz: f2fcad95edbf1e82e9f39a6cce495638abc44582
5
5
  SHA512:
6
- metadata.gz: e9ea9ad58db13d07e530c5d63c5260cc930ff121d351a9e4ff13e569ff621d70c212f971c0e82330c6d03f2e0ee73d06b93bb0060e1cbb7b158b41ccbc98c8e0
7
- data.tar.gz: d39ad9b53321c4b59951ae2832305aaa967cdee2ba3f7b6a266a72400927028f7c9590a46bff3492155a898ad472e0229178510d10bf183f009aebbab4933f17
6
+ metadata.gz: a9826251f28755f1c6b5f991b8dd95965d902bc5ef66eeb1b87a1a5049e3e595b2d1cb8e9e90248a1ed55cf23c0a2c0d6740150c54ecfba1bd1134cc8dc267ad
7
+ data.tar.gz: c098a9079ba080e923ca0258c05f1cd3ddb7ecc38acff879220769fac7cd64515463e401e47d4ee3323b4bad445923d7c10f387e4dfc23b5ddda0527f0b26ce3
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "bundler/setup"
4
- require "ddr/aux/client"
4
+ require "ddr_aux/client"
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
@@ -1,14 +1,28 @@
1
1
  module DdrAux::Client
2
2
  module Api
3
3
 
4
- def license(id)
5
- require_relative "license"
6
- License.call(id)
4
+ def license(arg)
5
+ if arg.respond_to?(:to_h)
6
+ find_license(**(arg.to_h))
7
+ else
8
+ get_license(arg)
9
+ end
7
10
  end
8
11
 
9
- def licenses(params=nil)
10
- require_relative "licenses"
11
- Licenses.call(params)
12
+ def get_license(id)
13
+ require_relative "api/get_license"
14
+ GetLicense.call(id)
15
+ end
16
+
17
+ def get_licenses
18
+ require_relative "api/get_licenses"
19
+ GetLicenses.call
20
+ end
21
+ alias_method :licenses, :get_licenses
22
+
23
+ def find_license(**args)
24
+ require_relative "api/find_license"
25
+ FindLicense.call(**args)
12
26
  end
13
27
 
14
28
  end
@@ -0,0 +1,10 @@
1
+ module DdrAux::Client
2
+ class FindLicense
3
+
4
+ def self.call(**args)
5
+ path = "/licenses/find?" + URI.encode_www_form(args)
6
+ Connection.call(path)
7
+ end
8
+
9
+ end
10
+ end
@@ -1,5 +1,5 @@
1
1
  module DdrAux::Client
2
- class License
2
+ class GetLicense
3
3
 
4
4
  def self.call(id)
5
5
  Connection.call("/licenses/#{id}")
@@ -0,0 +1,9 @@
1
+ module DdrAux::Client
2
+ class GetLicenses
3
+
4
+ def self.call
5
+ Connection.call("/licenses")
6
+ end
7
+
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
1
  module DdrAux
2
2
  module Client
3
- VERSION = "1.0.0.rc1"
3
+ VERSION = "1.0.0.rc2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ddr-aux-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc1
4
+ version: 1.0.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Chandek-Stark
@@ -84,9 +84,10 @@ files:
84
84
  - ddr-aux-client.gemspec
85
85
  - lib/ddr_aux/client.rb
86
86
  - lib/ddr_aux/client/api.rb
87
+ - lib/ddr_aux/client/api/find_license.rb
88
+ - lib/ddr_aux/client/api/get_license.rb
89
+ - lib/ddr_aux/client/api/get_licenses.rb
87
90
  - lib/ddr_aux/client/connection.rb
88
- - lib/ddr_aux/client/license.rb
89
- - lib/ddr_aux/client/licenses.rb
90
91
  - lib/ddr_aux/client/version.rb
91
92
  homepage: https://github.com/duke-libraries/ddr-aux-client
92
93
  licenses: []
@@ -1,13 +0,0 @@
1
- module DdrAux::Client
2
- class Licenses
3
-
4
- def self.call(params=nil)
5
- path = "/licenses"
6
- if params
7
- path << "?" + URI.encode_www_form(params)
8
- end
9
- Connection.call(path)
10
- end
11
-
12
- end
13
- end