aleph_api 0.1.0 → 0.2.0

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: b66c529a807fedc74fc2906f3f2d9cb43c1fabca
4
- data.tar.gz: 19b7f15ef2d1ea93c10bd3a8e665deabd4631d92
3
+ metadata.gz: 222c7396839063fb5d61484ef201b06b5c2af46a
4
+ data.tar.gz: f0a4590805f70d135053f8599e5615182d8e455a
5
5
  SHA512:
6
- metadata.gz: c533420154c0cd1bc6352c9e2c17a61b0a016095610b7aa2bebc0561d9449445b8c3fff4697bc302be396733c14c60478d375e57c80f3b45c2af4bc5962513b0
7
- data.tar.gz: cbf4b67132b92fcfcf5339ce61a20b6ff28667afb4b651a7c8cce160ec09baa020f58659751393706241143f759fca6612c81e53f2319c616a1ff619265f411e
6
+ metadata.gz: d472688306022b19d1dbe71e0fa3299e6e22bf569b6374de2a4f0dbfecd8aecfbe7b82d4a23d5ca8c78851c9ffcef00fd8ec700080b8a3d6a5f808ca63911382
7
+ data.tar.gz: fab4df3a58c5dbb3e3f391a0a2227410c61cc5d23bd7c69daaadee827dbc5df4acf91bf9ec3fefa463d719e51842a09e78beee83bb6902de3027a474d915b2d6
@@ -2,6 +2,7 @@ require_relative "../restful_api_client"
2
2
 
3
3
  class AlephApi::RestfulApiClient::Patron
4
4
  require_relative "./patron/circulation_actions"
5
+ require_relative "./patron/record"
5
6
 
6
7
  def initialize(client, patron_id)
7
8
  @client = client
@@ -17,4 +18,8 @@ class AlephApi::RestfulApiClient::Patron
17
18
  def circulationActions
18
19
  CirculationActions.new(@client, @patron_id)
19
20
  end
21
+
22
+ def record(record_id = nil)
23
+ Record.new(@client, @patron_id, record_id)
24
+ end
20
25
  end
@@ -0,0 +1,21 @@
1
+ require_relative "../patron"
2
+
3
+ class AlephApi::RestfulApiClient::Patron::Record
4
+ require_relative "./record/holds"
5
+
6
+ def initialize(client, patron_id, record_id)
7
+ @client = client
8
+ @patron_id = patron_id
9
+ @record_id = record_id
10
+ end
11
+
12
+ def get(options = {})
13
+ @client.http(:get, "/patron/#{@patron_id}/record/#{@record_id}", options).try do |_response|
14
+ _response.body
15
+ end
16
+ end
17
+
18
+ def holds(hold_group_id = nil)
19
+ Holds.new(@client, @patron_id, @record_id, hold_group_id)
20
+ end
21
+ end
@@ -0,0 +1,24 @@
1
+ require_relative "../circulation_actions"
2
+
3
+ class AlephApi::RestfulApiClient::Patron::Record::Holds
4
+ def initialize(client, patron_id, record_id, hold_group_id = nil)
5
+ @client = client
6
+ @patron_id = patron_id
7
+ @record_id = record_id
8
+ @hold_group_id = hold_group_id
9
+ end
10
+
11
+ def get(options = {})
12
+ @client.http(:get, url, options).try(:body)
13
+ end
14
+
15
+ def put(options = {})
16
+ @client.http(:put, url, options).try(:body)
17
+ end
18
+
19
+ private
20
+
21
+ def url
22
+ "/patron/#{@patron_id}/record/#{@record_id}/holds/#{@hold_group_id}".sub(/\/\Z/, "")
23
+ end
24
+ end
@@ -1,3 +1,3 @@
1
1
  module AlephApi
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aleph_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Sievers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-10-02 00:00:00.000000000 Z
11
+ date: 2015-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -124,6 +124,8 @@ files:
124
124
  - lib/aleph_api/restful_api_client/patron/circulation_actions/loans.rb
125
125
  - lib/aleph_api/restful_api_client/patron/circulation_actions/requests.rb
126
126
  - lib/aleph_api/restful_api_client/patron/circulation_actions/requests/holds.rb
127
+ - lib/aleph_api/restful_api_client/patron/record.rb
128
+ - lib/aleph_api/restful_api_client/patron/record/holds.rb
127
129
  - lib/aleph_api/restful_api_client/record.rb
128
130
  - lib/aleph_api/restful_api_client/record/items.rb
129
131
  - lib/aleph_api/version.rb