timdex-ruby 0.1.0 → 0.1.1

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: 1fa0dd79f9598647a865b2b748bffcf35b30032e4b30009a86f80ad2da54cb9a
4
- data.tar.gz: 4179d243857842a0a169c3485b01d4f1c5b5d474e39c8dfdd4d44542dd91f82c
3
+ metadata.gz: 7f904ae3f7bc2b1be636038caa87c3dc88aef17a6fb06a8329c395445f28153b
4
+ data.tar.gz: c31b45ec99e56263f6bb27a36503c95e21268046eac091c7b77c05d48d3978f4
5
5
  SHA512:
6
- metadata.gz: c05adc1ff4494f83aaebf3cb7513960a9d94545098935c155284873d4814e052fc33a06ecbfe8333c3c100ea923ca38fded4f6e7dc4e6748000bbe9714ad63d1
7
- data.tar.gz: 40741b6a553f28ccc81089986942404b07c0ffaa93349b823368165295160e798c96336184c2e9963a903f9f93bf3c6f3f35ae5fc1f3364e10a204b64c43e102
6
+ metadata.gz: ea6eafb263545bd1e399dc514646a81830e2f6263337623fddf3e9ae37b4c2e1571526263a5cc9fe10efd9444a9243cfa458f6a86d74dc1b740823cf2dc7eda3
7
+ data.tar.gz: eef2b48e914ac865744eb9831cf4f96363487fe93dc2805c14f70956feb3369bf4110d0bd81eb1c19a62ff714f6eb25ca4d3313a2001a80f81b3db32b843c44c
data/.gitignore CHANGED
@@ -9,3 +9,5 @@
9
9
  .byebug_history
10
10
  .env.development
11
11
  .env
12
+ *.gem
13
+ scratch.rb
@@ -42,4 +42,46 @@ class Record
42
42
  def content_type
43
43
  @record['content_type']
44
44
  end
45
+
46
+ def content_format
47
+ @record['content_format']
48
+ end
49
+
50
+ def imprint
51
+ @record['imprint']
52
+ end
53
+
54
+ def isbns
55
+ @record['isbns']
56
+ end
57
+
58
+ def issns
59
+ @record['issns']
60
+ end
61
+
62
+ def oclcs
63
+ @record['oclcs']
64
+ end
65
+
66
+ def lccn
67
+ @record['lccn']
68
+ end
69
+
70
+ # full record only
71
+
72
+ def notes
73
+ @record['notes']
74
+ end
75
+
76
+ def physical_description
77
+ @record['physical_description']
78
+ end
79
+
80
+ def languages
81
+ @record['languages']
82
+ end
83
+
84
+ def place_of_publication
85
+ @record['place_of_publication']
86
+ end
45
87
  end
@@ -43,6 +43,26 @@ module Timdex
43
43
  parse_results(json_results, response.status)
44
44
  end
45
45
 
46
+ def self.retrieve(id)
47
+ setup
48
+ auth unless validate_jwt
49
+ @conn.token_auth(@jwt)
50
+ response = @conn.get do |req|
51
+ req.url '/api/v1/record/' + id
52
+ req.headers['Authorization'] = "Bearer #{@jwt}"
53
+ end
54
+ json_result = JSON.parse(response.body)
55
+ parse_record(json_result, response.status)
56
+ end
57
+
58
+ def self.parse_record(json_result, status)
59
+ response = {}
60
+ response['status'] = status
61
+ response['record'] = Record.new(json_result)
62
+ response['raw'] = json_result
63
+ response
64
+ end
65
+
46
66
  def self.parse_results(json_results, status)
47
67
  results = {}
48
68
  results['status'] = status
@@ -1,3 +1,3 @@
1
1
  module Timdex
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timdex-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Prevost
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-07 00:00:00.000000000 Z
11
+ date: 2019-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  - !ruby/object:Gem::Version
150
150
  version: '0'
151
151
  requirements: []
152
- rubygems_version: 3.0.1
152
+ rubygems_version: 3.0.3
153
153
  signing_key:
154
154
  specification_version: 4
155
155
  summary: Ruby wrapper for MIT Libraries' TIMDEX Discovery API